mirror of
https://github.com/intel/llvm.git
synced 2026-02-08 00:50:03 +08:00
Fix <rdar://problem/6789707> "warning: 'extern' variable has an initializer" not correct for __private_extern__.
llvm-svn: 69167
This commit is contained in:
@@ -2488,7 +2488,7 @@ void Sema::AddInitializerToDecl(DeclPtrTy dcl, ExprArg init, bool DirectInit) {
|
||||
}
|
||||
}
|
||||
} else if (VDecl->isFileVarDecl()) {
|
||||
if (VDecl->hasExternalStorage())
|
||||
if (VDecl->getStorageClass() == VarDecl::Extern)
|
||||
Diag(VDecl->getLocation(), diag::warn_extern_init);
|
||||
if (!VDecl->isInvalidDecl())
|
||||
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;
|
||||
int g19 = 0;
|
||||
|
||||
// FIXME: linkage specifier in warning.
|
||||
__private_extern__ int g20 = 0; // expected-warning{{'extern' variable has an initializer}}
|
||||
__private_extern__ int g20 = 0;
|
||||
|
||||
Reference in New Issue
Block a user