aboutsummaryrefslogtreecommitdiff
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
commit5b34b9c5135971b01ed0dc8d4ef35cd3b79bd2c0 (patch)
treecfae7f9d51a95956094d56128d29590158f65568
parentb6bead467640e4d05f6a0a90255eebc939f690a2 (diff)
Fix thinko (and the bots): We still want to warn in C.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178335 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Sema/SemaDecl.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index 1c6bbedf5e..7c109a478f 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/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.