Add matcher for NamespaceDecls.
llvm-svn: 179027
diff --git a/clang/unittests/ASTMatchers/ASTMatchersTest.cpp b/clang/unittests/ASTMatchers/ASTMatchersTest.cpp
index 301b4f7..82f349f 100644
--- a/clang/unittests/ASTMatchers/ASTMatchersTest.cpp
+++ b/clang/unittests/ASTMatchers/ASTMatchersTest.cpp
@@ -337,14 +337,22 @@
" 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) {