[PATCH] D15149: Traverse the nested name specifier (loc) of namespace alias declarations.

Daniel Jasper via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 2 05:46:06 PST 2015


djasper created this revision.
djasper added a reviewer: klimek.
djasper added a subscriber: cfe-commits.
Herald added a subscriber: klimek.

http://reviews.llvm.org/D15149

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

Index: unittests/ASTMatchers/ASTMatchersTest.cpp
===================================================================
--- unittests/ASTMatchers/ASTMatchersTest.cpp
+++ unittests/ASTMatchers/ASTMatchersTest.cpp
@@ -4487,6 +4487,8 @@
                       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(); }",
Index: include/clang/AST/RecursiveASTVisitor.h
===================================================================
--- include/clang/AST/RecursiveASTVisitor.h
+++ include/clang/AST/RecursiveASTVisitor.h
@@ -1324,6 +1324,8 @@
 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.
   //


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D15149.41617.patch
Type: text/x-patch
Size: 1115 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20151202/15e39d90/attachment.bin>


More information about the cfe-commits mailing list