summaryrefslogtreecommitdiffstats
path: root/clang/lib/Index/USRGeneration.cpp
diff options
context:
space:
mode:
authorSam McCall <sam.mccall@gmail.com>2018-02-02 14:13:37 +0000
committerSam McCall <sam.mccall@gmail.com>2018-02-02 14:13:37 +0000
commit2e50ae6bf28b597753ed2ce0785b8aceaa46d9e0 (patch)
tree0507ed4c3dbe320323d756ce7505f09dd4ac5c78 /clang/lib/Index/USRGeneration.cpp
parentab68bbe515590866bd2492cb82e47bf5e93b8235 (diff)
downloadbcm5719-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.cpp4
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) {
OpenPOWER on IntegriCloud