[cfe-commits] r69167 - in /cfe/trunk: lib/Sema/SemaDecl.cpp test/Sema/private-extern.c

Steve Naroff snaroff at apple.com
Wed Apr 15 08:20:11 PDT 2009


Author: snaroff
Date: Wed Apr 15 10:20:03 2009
New Revision: 69167

URL: http://llvm.org/viewvc/llvm-project?rev=69167&view=rev
Log:
Fix <rdar://problem/6789707> "warning: 'extern' variable has an initializer" not correct for __private_extern__.

Modified:
    cfe/trunk/lib/Sema/SemaDecl.cpp
    cfe/trunk/test/Sema/private-extern.c

Modified: cfe/trunk/lib/Sema/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=69167&r1=69166&r2=69167&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/SemaDecl.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDecl.cpp Wed Apr 15 10:20:03 2009
@@ -2488,7 +2488,7 @@
       }
     }
   } else if (VDecl->isFileVarDecl()) {
-    if (VDecl->hasExternalStorage())
+    if (VDecl->getStorageClass() == VarDecl::Extern)
       Diag(VDecl->getLocation(), diag::warn_extern_init);
     if (!VDecl->isInvalidDecl())
       if (CheckInitializerTypes(Init, DclT, VDecl->getLocation(),

Modified: cfe/trunk/test/Sema/private-extern.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/private-extern.c?rev=69167&r1=69166&r2=69167&view=diff

==============================================================================
--- cfe/trunk/test/Sema/private-extern.c (original)
+++ cfe/trunk/test/Sema/private-extern.c Wed Apr 15 10:20:03 2009
@@ -85,5 +85,4 @@
 __private_extern__ int g19;
 int g19 = 0;
 
-// FIXME: linkage specifier in warning.
-__private_extern__ int g20 = 0; // expected-warning{{'extern' variable has an initializer}}
+__private_extern__ int g20 = 0;





More information about the cfe-commits mailing list