summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index 528cc65abfc..4a7c877fd98 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -1455,6 +1455,10 @@ void Sema::MergeVarDecl(VarDecl *New, LookupResult &Previous) {
return;
}
+ if (New->hasExternalStorage() &&
+ Old->getLinkage() == InternalLinkage)
+ New->setStorageClass(Old->getStorageClass());
+
// Keep a chain of previous declarations.
New->setPreviousDeclaration(Old);
OpenPOWER on IntegriCloud