]> granicus.if.org Git - clang/commitdiff
Traverse the NestedNameSpecifier(Loc) of NamespaceAliasDecls.
authorDaniel Jasper <djasper@google.com>
Wed, 2 Dec 2015 13:57:46 +0000 (13:57 +0000)
committerDaniel Jasper <djasper@google.com>
Wed, 2 Dec 2015 13:57:46 +0000 (13:57 +0000)
Review: http://reviews.llvm.org/D15149

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@254510 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/RecursiveASTVisitor.h
unittests/ASTMatchers/ASTMatchersTest.cpp

index 15d96fb4e96ac58b45d771aa76b30ddaffe0fb92..72fe26f4fdd0227134a04bd585cebd4690ff3029 100644 (file)
@@ -1324,6 +1324,8 @@ DEF_TRAVERSE_DECL(
 DEF_TRAVERSE_DECL(ExternCContextDecl, {})
 
 DEF_TRAVERSE_DECL(NamespaceAliasDecl, {
+  TRY_TO(TraverseNestedNameSpecifierLoc(D->getQualifierLoc()));
+
   // We shouldn't traverse an aliased namespace, since it will be
   // defined (and, therefore, traversed) somewhere else.
   //
index 90da356c323397f0ae82d012b98ea653ffeb4e20..51233e91303a62c9ead70a6a654e3ce74f6e09bd 100644 (file)
@@ -4487,6 +4487,8 @@ TEST(NNS, MatchesNestedNameSpecifiers) {
                       nestedNameSpecifier()));
   EXPECT_TRUE(matches("struct A { void f(); }; void A::f() {}",
                       nestedNameSpecifier()));
+  EXPECT_TRUE(matches("namespace a { namespace b {} } namespace ab = a::b;",
+                      nestedNameSpecifier()));
 
   EXPECT_TRUE(matches(
     "struct A { static void f() {} }; void g() { A::f(); }",