aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2013-03-29 07:02:31 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2013-03-29 07:02:31 +0000
commitb6bead467640e4d05f6a0a90255eebc939f690a2 (patch)
tree8cb3c0d0dae84b058e73ab63e30d834c43aa4a67 /lib/Sema/SemaDecl.cpp
parent1bfc28c48c1b86a05d2e07b403107ef3da5a0f8e (diff)
Don't special case one line extern "C" decls.
We already avoided warning for extern "C" const char *Version_string = "2.9"; now we also don't produce any warnings for extern "C" { extern const char *Version_string2 = "2.9"; } git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178333 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r--lib/Sema/SemaDecl.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index ab4a17a30d..1c6bbedf5e 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -7565,6 +7565,7 @@ 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()))
Diag(VDecl->getLocation(), diag::warn_extern_init);