Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow --Wdisable to take precedence over --Werror for warning messages #4894

Merged
merged 8 commits into from
Sep 17, 2024
4 changes: 1 addition & 3 deletions lib/error_reporter.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class ErrorReporter {
/// and source info.
/// If the error has been reported, return true. Otherwise, insert add the error to the
/// list of seen errors, and return false.
bool error_reported(int err, Util::SourceInfo source) {
bool error_reported(int err, const Util::SourceInfo source) {
if (!source.isValid()) return false;
auto p = errorTracker.emplace(err, source);
return !p.second; // if insertion took place, then we have not seen the error.
Expand Down Expand Up @@ -226,8 +226,6 @@ class ErrorReporter {
/// @return the action to take for the given diagnostic, falling back to the
/// default action if it wasn't overridden via the command line or a pragma.
DiagnosticAction getDiagnosticAction(cstring diagnostic, DiagnosticAction defaultAction) {
// Actions for errors can never be overridden.
if (defaultAction == DiagnosticAction::Error) return defaultAction;
auto it = diagnosticActions.find(diagnostic);
if (it != diagnosticActions.end()) return it->second;
// if we're dealing with warnings and they have been globally modified
Expand Down
Loading