diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2013-03-29 07:56:05 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2013-03-29 07:56:05 +0000 |
commit | 069ab0345b7d742fc258a6d296c853200c2e6c0a (patch) | |
tree | 73e865b5dffdec35821915e52f54b49da7075477 | |
parent | de657514930edc1bafe28494d0ad7c4de2a4c80a (diff) | |
download | bcm5719-llvm-069ab0345b7d742fc258a6d296c853200c2e6c0a.tar.gz bcm5719-llvm-069ab0345b7d742fc258a6d296c853200c2e6c0a.zip |
Fix thinko (and the bots): We still want to warn in C.
llvm-svn: 178335
-rw-r--r-- | clang/lib/Sema/SemaDecl.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index 1c6bbedf5ef..7c109a478f2 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -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. |