From: Alex Lorenz Date: Tue, 4 Jul 2017 12:50:53 +0000 (+0000) Subject: [index] Index nested name qualifiers in a forward declaration of a X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e762c504a0b4cddf10389e46516492881b85e87b;p=clang [index] Index nested name qualifiers in a forward declaration of a class template specialization rdar://33122110 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307074 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Index/IndexDecl.cpp b/lib/Index/IndexDecl.cpp index d1127722c8..c5230c0f9a 100644 --- a/lib/Index/IndexDecl.cpp +++ b/lib/Index/IndexDecl.cpp @@ -618,6 +618,8 @@ public: Template.is() ? (Decl *)Template.get() : Template.get(); + if (!D->isThisDeclarationADefinition()) + IndexCtx.indexNestedNameSpecifierLoc(D->getQualifierLoc(), D); IndexCtx.indexTagDecl( D, SymbolRelation(SymbolRoleSet(SymbolRole::RelationSpecializationOf), SpecializationOf)); diff --git a/test/Index/Core/index-source.cpp b/test/Index/Core/index-source.cpp index 6d20fdd48e..4864d6cf01 100644 --- a/test/Index/Core/index-source.cpp +++ b/test/Index/Core/index-source.cpp @@ -496,3 +496,19 @@ void localStructuredBindingAndRef() { } } + +namespace rd33122110 { + +struct Outer { + template + struct Nested { }; +}; + +} + +template<> +struct rd33122110::Outer::Nested; +// CHECK: [[@LINE-1]]:8 | namespace/C++ | rd33122110 | c:@N@rd33122110 | | 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 | | Ref,RelCont | rel: 1 +// CHECK-NEXT: RelCont | Nested | c:@N@rd33122110@S@Outer@S@Nested>#I