summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/Decl.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2013-03-12 15:22:39 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2013-03-12 15:22:39 +0000
commitb22b91c3e4c23fdafec2cb05d65972955152f7f6 (patch)
treecb8a64ff64c288de4b011b3f50132a5d709208e8 /clang/lib/AST/Decl.cpp
parent01271c602288ccec767645bce3579c842e45ed40 (diff)
downloadbcm5719-llvm-b22b91c3e4c23fdafec2cb05d65972955152f7f6.tar.gz
bcm5719-llvm-b22b91c3e4c23fdafec2cb05d65972955152f7f6.zip
Correctly compute linkage of decls forward declared extern C.
This fixes a crash in namespace { struct X {}; } extern "C" X test2_b; X test2_b before we would assign different linkages to each of the test2_b decls. llvm-svn: 176869
Diffstat (limited to 'clang/lib/AST/Decl.cpp')
-rw-r--r--clang/lib/AST/Decl.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/clang/lib/AST/Decl.cpp b/clang/lib/AST/Decl.cpp
index c2168a2102a..9ee70e25108 100644
--- a/clang/lib/AST/Decl.cpp
+++ b/clang/lib/AST/Decl.cpp
@@ -620,8 +620,7 @@ static LinkageInfo getLVForNamespaceScopeDecl(const NamedDecl *D,
//
// Note that we don't want to make the variable non-external
// because of this, but unique-external linkage suits us.
- if (Context.getLangOpts().CPlusPlus &&
- !Var->getDeclContext()->isExternCContext()) {
+ if (Context.getLangOpts().CPlusPlus && !isInExternCContext(Var)) {
LinkageInfo TypeLV = Var->getType()->getLinkageAndVisibility();
if (TypeLV.getLinkage() != ExternalLinkage)
return LinkageInfo::uniqueExternal();
OpenPOWER on IntegriCloud