mirror of
https://github.com/intel/llvm.git
synced 2026-02-02 02:00:03 +08:00
Move policy on unnamed fields (a Microsoft extension) from Parser::ParseStructDeclaration() to the driver.
llvm-svn: 46974
This commit is contained in:
@@ -440,6 +440,9 @@ static void InitializeDiagnostics(Diagnostic &Diags) {
|
||||
diag::MAP_IGNORE);
|
||||
if (!WarnUndefMacros)
|
||||
Diags.setDiagnosticMapping(diag::warn_pp_undef_identifier,diag::MAP_IGNORE);
|
||||
|
||||
if (MSExtensions) // MS allows unnamed struct/union fields.
|
||||
Diags.setDiagnosticMapping(diag::w_no_declarators, diag::MAP_IGNORE);
|
||||
}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
@@ -671,8 +671,7 @@ void Parser::ParseStructDeclaration(DeclTy *TagDecl,
|
||||
|
||||
// If there are no declarators, issue a warning.
|
||||
if (Tok.is(tok::semi)) {
|
||||
if (!getLang().Microsoft) // MS allows unnamed struct/union fields.
|
||||
Diag(SpecQualLoc, diag::w_no_declarators);
|
||||
Diag(SpecQualLoc, diag::w_no_declarators);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user