]> granicus.if.org Git - clang/commitdiff
Don't complain about a variable within a linkage-specification that is
authorDouglas Gregor <dgregor@apple.com>
Fri, 15 Oct 2010 01:21:46 +0000 (01:21 +0000)
committerDouglas Gregor <dgregor@apple.com>
Fri, 15 Oct 2010 01:21:46 +0000 (01:21 +0000)
initialized. Fixes PR7076.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116553 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaDecl.cpp
test/SemaCXX/linkage-spec.cpp

index 93909f995d446aad4f2ccf7856f553aa6646cb3b..4a834cd56013102e9e752308d89307f037f0e455 100644 (file)
@@ -4339,7 +4339,7 @@ void Sema::AddInitializerToDecl(Decl *RealDecl, Expr *Init, bool DirectInit) {
       }
     }
   } else if (VDecl->isFileVarDecl()) {
-    if (VDecl->getStorageClass() == SC_Extern && 
+    if (VDecl->getStorageClassAsWritten() == SC_Extern && 
         (!getLangOptions().CPlusPlus || 
          !Context.getBaseElementType(VDecl->getType()).isConstQualified()))
       Diag(VDecl->getLocation(), diag::warn_extern_init);
index 86c3d3e87a4cc2351c66debadc2e11876e1d0534..b5a10a795ebc205939a897f31d1326453b9089eb 100644 (file)
@@ -86,3 +86,6 @@ namespace N {
 }
 
 extern "C++" using N::value;
+
+// PR7076
+extern "C" const char *Version_string = "2.9";