зеркало из https://github.com/microsoft/clang.git
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
This commit is contained in:
Родитель
99ea7343ce
Коммит
66c42d4439
|
@ -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);
|
||||
|
|
|
@ -86,3 +86,6 @@ namespace N {
|
|||
}
|
||||
|
||||
extern "C++" using N::value;
|
||||
|
||||
// PR7076
|
||||
extern "C" const char *Version_string = "2.9";
|
||||
|
|
Загрузка…
Ссылка в новой задаче