diff options
author | Sam McCall <sam.mccall@gmail.com> | 2018-02-02 14:13:37 +0000 |
---|---|---|
committer | Sam McCall <sam.mccall@gmail.com> | 2018-02-02 14:13:37 +0000 |
commit | 2e50ae6bf28b597753ed2ce0785b8aceaa46d9e0 (patch) | |
tree | 0507ed4c3dbe320323d756ce7505f09dd4ac5c78 /clang/lib/Index/USRGeneration.cpp | |
parent | ab68bbe515590866bd2492cb82e47bf5e93b8235 (diff) | |
download | bcm5719-llvm-2e50ae6bf28b597753ed2ce0785b8aceaa46d9e0.tar.gz bcm5719-llvm-2e50ae6bf28b597753ed2ce0785b8aceaa46d9e0.zip |
[Index] fix USR generation for namespace{extern{X}}
llvm-svn: 324093
Diffstat (limited to 'clang/lib/Index/USRGeneration.cpp')
-rw-r--r-- | clang/lib/Index/USRGeneration.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/Index/USRGeneration.cpp b/clang/lib/Index/USRGeneration.cpp index 3a06554b256..ee1c950eb69 100644 --- a/clang/lib/Index/USRGeneration.cpp +++ b/clang/lib/Index/USRGeneration.cpp @@ -103,7 +103,7 @@ public: void VisitUnresolvedUsingTypenameDecl(const UnresolvedUsingTypenameDecl *D); void VisitLinkageSpecDecl(const LinkageSpecDecl *D) { - IgnoreResults = true; + IgnoreResults = true; // No USRs for linkage specs themselves. } void VisitUsingDirectiveDecl(const UsingDirectiveDecl *D) { @@ -192,6 +192,8 @@ bool USRGenerator::ShouldGenerateLocation(const NamedDecl *D) { void USRGenerator::VisitDeclContext(const DeclContext *DC) { if (const NamedDecl *D = dyn_cast<NamedDecl>(DC)) Visit(D); + else if (isa<LinkageSpecDecl>(DC)) // Linkage specs are transparent in USRs. + VisitDeclContext(DC->getParent()); } void USRGenerator::VisitFieldDecl(const FieldDecl *D) { |