forked from OSchip/llvm-project
Fix <rdar://problem/6789707> "warning: 'extern' variable has an initializer" not correct for __private_extern__.
llvm-svn: 69167
This commit is contained in:
parent
5a8c8df08c
commit
635168aa33
|
@ -2488,7 +2488,7 @@ void Sema::AddInitializerToDecl(DeclPtrTy dcl, ExprArg init, bool DirectInit) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (VDecl->isFileVarDecl()) {
|
} else if (VDecl->isFileVarDecl()) {
|
||||||
if (VDecl->hasExternalStorage())
|
if (VDecl->getStorageClass() == VarDecl::Extern)
|
||||||
Diag(VDecl->getLocation(), diag::warn_extern_init);
|
Diag(VDecl->getLocation(), diag::warn_extern_init);
|
||||||
if (!VDecl->isInvalidDecl())
|
if (!VDecl->isInvalidDecl())
|
||||||
if (CheckInitializerTypes(Init, DclT, VDecl->getLocation(),
|
if (CheckInitializerTypes(Init, DclT, VDecl->getLocation(),
|
||||||
|
|
|
@ -85,5 +85,4 @@ extern int g18 = 0; // expected-warning{{'extern' variable has an initializer}}
|
||||||
__private_extern__ int g19;
|
__private_extern__ int g19;
|
||||||
int g19 = 0;
|
int g19 = 0;
|
||||||
|
|
||||||
// FIXME: linkage specifier in warning.
|
__private_extern__ int g20 = 0;
|
||||||
__private_extern__ int g20 = 0; // expected-warning{{'extern' variable has an initializer}}
|
|
||||||
|
|
Loading…
Reference in New Issue