Fix <rdar://problem/6789707> "warning: 'extern' variable has an initializer" not correct for __private_extern__.

llvm-svn: 69167
This commit is contained in:
Steve Naroff 2009-04-15 15:20:03 +00:00
parent 5a8c8df08c
commit 635168aa33
2 changed files with 2 additions and 3 deletions

View File

@ -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(),

View File

@ -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;