forked from OSchip/llvm-project
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"; } llvm-svn: 178333
This commit is contained in:
parent
67ce1472b4
commit
980c053cb9
|
@ -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);
|
||||
|
|
|
@ -90,6 +90,10 @@ extern "C++" using N::value;
|
|||
// PR7076
|
||||
extern "C" const char *Version_string = "2.9";
|
||||
|
||||
extern "C" {
|
||||
extern const char *Version_string2 = "2.9";
|
||||
}
|
||||
|
||||
namespace PR9162 {
|
||||
extern "C" {
|
||||
typedef struct _ArtsSink ArtsSink;
|
||||
|
|
Loading…
Reference in New Issue