Fix thinko (and the bots): We still want to warn in C.

llvm-svn: 178335
This commit is contained in:
Rafael Espindola 2013-03-29 07:56:05 +00:00
parent de65751493
commit 069ab0345b
1 changed files with 2 additions and 2 deletions

View File

@ -7565,9 +7565,9 @@ void Sema::AddInitializerToDecl(Decl *RealDecl, Expr *Init,
}
} else if (VDecl->isFileVarDecl()) {
if (VDecl->getStorageClassAsWritten() == SC_Extern &&
!VDecl->isExternC() &&
(!getLangOpts().CPlusPlus ||
!Context.getBaseElementType(VDecl->getType()).isConstQualified()))
!(Context.getBaseElementType(VDecl->getType()).isConstQualified() ||
VDecl->isExternC())))
Diag(VDecl->getLocation(), diag::warn_extern_init);
// C99 6.7.8p4. All file scoped initializers need to be constant.