forked from OSchip/llvm-project
Fixes a regression when redeclaration of a global satic
is an extern local to a function. Radar 8125274. llvm-svn: 106773
This commit is contained in:
parent
3f0e992af1
commit
4f9c9d6591
|
@ -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.
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
// RUN: %clang_cc1 -fsyntax-only %s
|
||||
|
||||
// rdar: // 8125274
|
||||
static int a16[]; // expected-warning {{tentative array definition assumed to have one element}}
|
||||
|
||||
void f16(void) {
|
||||
extern int a16[];
|
||||
}
|
||||
|
Loading…
Reference in New Issue