diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-10-15 01:21:46 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-10-15 01:21:46 +0000 |
commit | 66c42d443982a0891ce58deb7391d641ca87adc5 (patch) | |
tree | eb060dfd5ea993fa9e660003587446eb10ff1773 /lib/Sema/SemaDecl.cpp | |
parent | 99ea7343ce6d23157427a59eaf969596e8ed609f (diff) |
Don't complain about a variable within a linkage-specification that is
initialized. Fixes PR7076.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116553 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r-- | lib/Sema/SemaDecl.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index 93909f995d..4a834cd560 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -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); |