summaryrefslogtreecommitdiffstats
path: root/clang/unittests/ASTMatchers/ASTMatchersTest.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2013-04-08 16:44:05 +0000
committerDaniel Jasper <djasper@google.com>2013-04-08 16:44:05 +0000
commit9fcdc461edf9276b294e78c023b7a94b5ebc43d8 (patch)
tree7e6d4ef58213552988646ebb1b9b7c60244041c7 /clang/unittests/ASTMatchers/ASTMatchersTest.cpp
parentb5aa7e54d9e16a7c7282d78387a057ae74daa877 (diff)
downloadbcm5719-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.cpp12
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) {
OpenPOWER on IntegriCloud