diff options
author | Edwin Vane <edwin.vane@intel.com> | 2013-02-25 14:32:42 +0000 |
---|---|---|
committer | Edwin Vane <edwin.vane@intel.com> | 2013-02-25 14:32:42 +0000 |
commit | ed936457393fa19d86bd9223f815b8cead44e20d (patch) | |
tree | f2b8a7f5615fab2b3be70743a873eb53b44b4903 /clang/unittests/ASTMatchers/ASTMatchersTest.cpp | |
parent | 121dbf884633d04a72d754fab34d6039e7b785a6 (diff) | |
download | bcm5719-llvm-ed936457393fa19d86bd9223f815b8cead44e20d.tar.gz bcm5719-llvm-ed936457393fa19d86bd9223f815b8cead44e20d.zip |
Support in hasDeclaration for types with getDecl()
Re-introducing r175532. The has_getDecl metafunction didn't compile with
Visual Studio. This revision uses approaches has_getDecl from a
different angle that isn't a problem for Visual Studio.
Added dedicated tests for the metafunction.
Reviewers: klimek
llvm-svn: 176024
Diffstat (limited to 'clang/unittests/ASTMatchers/ASTMatchersTest.cpp')
-rw-r--r-- | clang/unittests/ASTMatchers/ASTMatchersTest.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/unittests/ASTMatchers/ASTMatchersTest.cpp b/clang/unittests/ASTMatchers/ASTMatchersTest.cpp index 63017473f42..a759df9070f 100644 --- a/clang/unittests/ASTMatchers/ASTMatchersTest.cpp +++ b/clang/unittests/ASTMatchers/ASTMatchersTest.cpp @@ -818,6 +818,12 @@ TEST(HasDeclaration, HasDeclarationOfEnumType) { qualType(hasDeclaration(enumDecl(hasName("X"))))))))); } +TEST(HasDeclaration, HasGetDeclTraitTest) { + EXPECT_TRUE(internal::has_getDecl<TypedefType>::value); + EXPECT_TRUE(internal::has_getDecl<RecordType>::value); + EXPECT_FALSE(internal::has_getDecl<TemplateSpecializationType>::value); +} + TEST(HasDeclaration, HasDeclarationOfTypeWithDecl) { EXPECT_TRUE(matches("typedef int X; X a;", varDecl(hasName("a"), |