summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2013-03-29 07:56:05 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2013-03-29 07:56:05 +0000
commit069ab0345b7d742fc258a6d296c853200c2e6c0a (patch)
tree73e865b5dffdec35821915e52f54b49da7075477
parentde657514930edc1bafe28494d0ad7c4de2a4c80a (diff)
downloadbcm5719-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.cpp4
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.
OpenPOWER on IntegriCloud