Move policy on unnamed fields (a Microsoft extension) from Parser::ParseStructDeclaration() to the driver.

llvm-svn: 46974
This commit is contained in:
Steve Naroff 2008-02-11 22:40:08 +00:00
parent 5915777fca
commit bff738543d
2 changed files with 4 additions and 2 deletions

View File

@ -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);
}
//===----------------------------------------------------------------------===//

View File

@ -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;
}