r307074 - [index] Index nested name qualifiers in a forward declaration of a

Alex Lorenz via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 4 05:50:54 PDT 2017


Author: arphaman
Date: Tue Jul  4 05:50:53 2017
New Revision: 307074

URL: http://llvm.org/viewvc/llvm-project?rev=307074&view=rev
Log:
[index] Index nested name qualifiers in a forward declaration of a
class template specialization

rdar://33122110

Modified:
    cfe/trunk/lib/Index/IndexDecl.cpp
    cfe/trunk/test/Index/Core/index-source.cpp

Modified: cfe/trunk/lib/Index/IndexDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Index/IndexDecl.cpp?rev=307074&r1=307073&r2=307074&view=diff
==============================================================================
--- cfe/trunk/lib/Index/IndexDecl.cpp (original)
+++ cfe/trunk/lib/Index/IndexDecl.cpp Tue Jul  4 05:50:53 2017
@@ -618,6 +618,8 @@ public:
         Template.is<ClassTemplateDecl *>()
             ? (Decl *)Template.get<ClassTemplateDecl *>()
             : Template.get<ClassTemplatePartialSpecializationDecl *>();
+    if (!D->isThisDeclarationADefinition())
+      IndexCtx.indexNestedNameSpecifierLoc(D->getQualifierLoc(), D);
     IndexCtx.indexTagDecl(
         D, SymbolRelation(SymbolRoleSet(SymbolRole::RelationSpecializationOf),
                           SpecializationOf));

Modified: cfe/trunk/test/Index/Core/index-source.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/Core/index-source.cpp?rev=307074&r1=307073&r2=307074&view=diff
==============================================================================
--- cfe/trunk/test/Index/Core/index-source.cpp (original)
+++ cfe/trunk/test/Index/Core/index-source.cpp Tue Jul  4 05:50:53 2017
@@ -496,3 +496,19 @@ void localStructuredBindingAndRef() {
 }
 
 }
+
+namespace rd33122110 {
+
+struct Outer {
+    template<typename T>
+    struct Nested { };
+};
+
+}
+
+template<>
+struct rd33122110::Outer::Nested<int>;
+// CHECK: [[@LINE-1]]:8 | namespace/C++ | rd33122110 | c:@N at rd33122110 | <no-cgname> | Ref,RelCont | rel: 1
+// CHECK-NEXT: RelCont | Nested | c:@N at rd33122110@S at Outer@S at Nested>#I
+// CHECK: [[@LINE-3]]:20 | struct/C++ | Outer | c:@N at rd33122110@S at Outer | <no-cgname> | Ref,RelCont | rel: 1
+// CHECK-NEXT: RelCont | Nested | c:@N at rd33122110@S at Outer@S at Nested>#I




More information about the cfe-commits mailing list