Fix PR2281: these two warnings should be promoted to error on

pedantic error.  Perhaps I should add a class of 'extension' that is
'extension that warns by default', which would be cleaner.

llvm-svn: 50633
This commit is contained in:
Chris Lattner 2008-05-04 23:52:02 +00:00
parent ca671b0e51
commit de977c0a5c
1 changed files with 9 additions and 0 deletions

View File

@ -500,6 +500,15 @@ static void InitializeDiagnostics(Diagnostic &Diags) {
if (MSExtensions) // MS allows unnamed struct/union fields.
Diags.setDiagnosticMapping(diag::w_no_declarators, diag::MAP_IGNORE);
// If -pedantic-errors is set, turn extensions that warn by default into
// errors.
if (ErrorOnExtensions) {
Diags.setDiagnosticMapping(diag::warn_hex_escape_too_large,
diag::MAP_ERROR);
Diags.setDiagnosticMapping(diag::warn_octal_escape_too_large,
diag::MAP_ERROR);
}
}
//===----------------------------------------------------------------------===//