Don't warn about -Wno-foo where foo is an unknown warning option. Explicitly

passing -Wunknown-warning-option will re-enable warnings about -Wno-foo.

llvm-svn: 132570
This commit is contained in:
Matt Beaumont-Gay 2011-06-03 18:30:50 +00:00
parent 6fc542c49b
commit aef8c72255
2 changed files with 6 additions and 1 deletions

View File

@ -281,6 +281,9 @@ def err_not_a_pch_file : Error<
def warn_unknown_warning_option : Warning<
"unknown warning option '%0'">,
InGroup<DiagGroup<"unknown-warning-option"> >;
def warn_unknown_negative_warning_option : Warning<
"unknown warning option '%0'">,
InGroup<DiagGroup<"unknown-warning-option"> >, DefaultIgnore;
def warn_unknown_warning_specifier : Warning<
"unknown %0 warning specifier: '%1'">,
InGroup<DiagGroup<"unknown-warning-option"> >;

View File

@ -123,6 +123,8 @@ void clang::ProcessWarningOptions(Diagnostic &Diags,
}
if (Diags.setDiagnosticGroupMapping(Opt, Mapping))
Diags.Report(diag::warn_unknown_warning_option) << ("-W" + Opt.str());
Diags.Report(isPositive ? diag::warn_unknown_warning_option :
diag::warn_unknown_negative_warning_option)
<< ("-W" + Opt.str());
}
}