diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2010-06-24 18:50:41 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2010-06-24 18:50:41 +0000 |
commit | 7d99e989c1a20e358f472e35d615313f2fe223db (patch) | |
tree | f1c16c8a068c8a31567868a45662ced1bb034c25 /lib | |
parent | 8147c7b29d5bfc1883e9f13490e0b23916077617 (diff) |
Fixes a regression when redeclaration of a global satic
is an extern local to a function. Radar 8125274.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106773 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Sema/SemaDecl.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index ebfb9810d6..5c1de6aeb8 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -1456,7 +1456,8 @@ void Sema::MergeVarDecl(VarDecl *New, LookupResult &Previous) { } if (New->hasExternalStorage() && - Old->getLinkage() == InternalLinkage) + Old->getLinkage() == InternalLinkage && + New->getDeclContext() == Old->getDeclContext()) New->setStorageClass(Old->getStorageClass()); // Keep a chain of previous declarations. |