diff options
author | Daniel Jasper <djasper@google.com> | 2013-04-08 16:44:05 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2013-04-08 16:44:05 +0000 |
commit | 9fcdc461edf9276b294e78c023b7a94b5ebc43d8 (patch) | |
tree | 7e6d4ef58213552988646ebb1b9b7c60244041c7 /clang/unittests/ASTMatchers/ASTMatchersTest.cpp | |
parent | b5aa7e54d9e16a7c7282d78387a057ae74daa877 (diff) | |
download | bcm5719-llvm-9fcdc461edf9276b294e78c023b7a94b5ebc43d8.tar.gz bcm5719-llvm-9fcdc461edf9276b294e78c023b7a94b5ebc43d8.zip |
Add matcher for NamespaceDecls.
llvm-svn: 179027
Diffstat (limited to 'clang/unittests/ASTMatchers/ASTMatchersTest.cpp')
-rw-r--r-- | clang/unittests/ASTMatchers/ASTMatchersTest.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/clang/unittests/ASTMatchers/ASTMatchersTest.cpp b/clang/unittests/ASTMatchers/ASTMatchersTest.cpp index 301b4f7c8a8..82f349fb0e8 100644 --- a/clang/unittests/ASTMatchers/ASTMatchersTest.cpp +++ b/clang/unittests/ASTMatchers/ASTMatchersTest.cpp @@ -337,14 +337,22 @@ TEST(DeclarationMatcher, hasDeclContext) { " class D {};" " }" "}", - recordDecl(hasDeclContext(namedDecl(hasName("M")))))); + recordDecl(hasDeclContext(namespaceDecl(hasName("M")))))); EXPECT_TRUE(notMatches( "namespace N {" " namespace M {" " class D {};" " }" "}", - recordDecl(hasDeclContext(namedDecl(hasName("N")))))); + recordDecl(hasDeclContext(namespaceDecl(hasName("N")))))); + + EXPECT_TRUE(matches("namespace {" + " namespace M {" + " class D {};" + " }" + "}", + recordDecl(hasDeclContext(namespaceDecl( + hasName("M"), hasDeclContext(namespaceDecl())))))); } TEST(ClassTemplate, DoesNotMatchClass) { |