diff options
| author | Matthias Gehre <M.Gehre@gmx.de> | 2015-10-12 21:46:07 +0000 |
|---|---|---|
| committer | Matthias Gehre <M.Gehre@gmx.de> | 2015-10-12 21:46:07 +0000 |
| commit | 2cf7e803bb5ec24ce1ac1d81bffe46edd7324e8a (patch) | |
| tree | 482f51a82c7a078af469548b5773afb6a28b27e3 /clang/unittests/ASTMatchers/ASTMatchersTest.cpp | |
| parent | f4ebc08831d0a42d8ef455c5b773da888d957087 (diff) | |
| download | bcm5719-llvm-2cf7e803bb5ec24ce1ac1d81bffe46edd7324e8a.tar.gz bcm5719-llvm-2cf7e803bb5ec24ce1ac1d81bffe46edd7324e8a.zip | |
Add decayedType and hasDecayedType AST matchers
Summary: Add decayedType and hasDecayedType AST matchers
Reviewers: klimek
Subscribers: klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D13639
llvm-svn: 250114
Diffstat (limited to 'clang/unittests/ASTMatchers/ASTMatchersTest.cpp')
| -rw-r--r-- | clang/unittests/ASTMatchers/ASTMatchersTest.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/unittests/ASTMatchers/ASTMatchersTest.cpp b/clang/unittests/ASTMatchers/ASTMatchersTest.cpp index 4954402e83b..828e71b35ca 100644 --- a/clang/unittests/ASTMatchers/ASTMatchersTest.cpp +++ b/clang/unittests/ASTMatchers/ASTMatchersTest.cpp @@ -4109,6 +4109,11 @@ TEST(TypeMatching, MatchesArrayTypes) { EXPECT_TRUE(matches("const int a = 0;", qualType(isInteger()))); } +TEST(TypeMatching, DecayedType) { + EXPECT_TRUE(matches("void f(int i[]);", valueDecl(hasType(decayedType(hasDecayedType(pointerType())))))); + EXPECT_TRUE(notMatches("int i[7];", decayedType())); +} + TEST(TypeMatching, MatchesComplexTypes) { EXPECT_TRUE(matches("_Complex float f;", complexType())); EXPECT_TRUE(matches( |

