]> granicus.if.org Git - clang/commitdiff
[index] Index nested name qualifiers in a forward declaration of a
authorAlex Lorenz <arphaman@gmail.com>
Tue, 4 Jul 2017 12:50:53 +0000 (12:50 +0000)
committerAlex Lorenz <arphaman@gmail.com>
Tue, 4 Jul 2017 12:50:53 +0000 (12:50 +0000)
class template specialization

rdar://33122110

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

lib/Index/IndexDecl.cpp
test/Index/Core/index-source.cpp

index d1127722c8ca3da8052ed90652724fa34749f85e..c5230c0f9acf89e4b3e060ed9a40cf7447589f57 100644 (file)
@@ -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));
index 6d20fdd48e50f711b212738e0c99843e5058077b..4864d6cf0150ad78df1c37990ff10654d122b8ef 100644 (file)
@@ -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@rd33122110 | <no-cgname> | Ref,RelCont | rel: 1
+// CHECK-NEXT: RelCont | Nested | c:@N@rd33122110@S@Outer@S@Nested>#I
+// CHECK: [[@LINE-3]]:20 | struct/C++ | Outer | c:@N@rd33122110@S@Outer | <no-cgname> | Ref,RelCont | rel: 1
+// CHECK-NEXT: RelCont | Nested | c:@N@rd33122110@S@Outer@S@Nested>#I