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

Rafael Espindola rafael.espindola at gmail.com
Fri Mar 29 00:56:05 PDT 2013


Author: rafael
Date: Fri Mar 29 02:56:05 2013
New Revision: 178335

URL: http://llvm.org/viewvc/llvm-project?rev=178335&view=rev
Log:
Fix thinko (and the bots): We still want to warn in C.

Modified:
    cfe/trunk/lib/Sema/SemaDecl.cpp

Modified: cfe/trunk/lib/Sema/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=178335&r1=178334&r2=178335&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDecl.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDecl.cpp Fri Mar 29 02:56:05 2013
@@ -7565,9 +7565,9 @@ void Sema::AddInitializerToDecl(Decl *Re
     }
   } 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.





More information about the cfe-commits mailing list