aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-10-15 01:21:46 +0000
committerDouglas Gregor <dgregor@apple.com>2010-10-15 01:21:46 +0000
commit66c42d443982a0891ce58deb7391d641ca87adc5 (patch)
treeeb060dfd5ea993fa9e660003587446eb10ff1773 /lib/Sema/SemaDecl.cpp
parent99ea7343ce6d23157427a59eaf969596e8ed609f (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.cpp2
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);