diff options
author | Edwin Vane <edwin.vane@intel.com> | 2013-02-25 13:59:06 +0000 |
---|---|---|
committer | Edwin Vane <edwin.vane@intel.com> | 2013-02-25 13:59:06 +0000 |
commit | 0b6f23a23c55b7024e7a0edca1fecf9bd4c380a1 (patch) | |
tree | 7e8f866688772164283d3960c1746856d1f8cb7a /unittests/ASTMatchers/ASTMatchersTest.cpp | |
parent | c7093d96d1fac7f34acd2b63bca4ea39acb5cad5 (diff) |
Support in hasDeclaration for types with getDecl()
Re-introducing r175532. The has_getDecl metafunction didn't compile with Visual
Studio. This revision approaches has_getDecl from a different angle that isn't
a problem for Visual Studio.
Added dedicated tests for the metafunction.
Reviewers: klimek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176019 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/ASTMatchers/ASTMatchersTest.cpp')
-rw-r--r-- | unittests/ASTMatchers/ASTMatchersTest.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/unittests/ASTMatchers/ASTMatchersTest.cpp b/unittests/ASTMatchers/ASTMatchersTest.cpp index 63017473f4..a759df9070 100644 --- a/unittests/ASTMatchers/ASTMatchersTest.cpp +++ b/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"), |