Skip to content

Commit

Permalink
[cling] Always promote warn_falloff_nonvoid_function to error
Browse files Browse the repository at this point in the history
This diagnostic should always be promoted to error, regardless of the ignoring
state in `FilteringDiagConsumer`.
This fixes the SourceCall/ErrorMacro.C test.

The failure became visible after merging
root-project#12654, given that `IgnorePromptDiags`
now defaults to 0 in `makeDefaultCompilationOptions()`.
  • Loading branch information
jalopezg-git authored and enirolf committed May 25, 2023
1 parent ab40a7e commit 3633810
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions interpreter/cling/lib/Interpreter/IncrementalParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,15 +162,15 @@ namespace {

void HandleDiagnostic(DiagnosticsEngine::Level DiagLevel,
const Diagnostic &Info) override {
if (Info.getID() == diag::warn_falloff_nonvoid_function) {
DiagLevel = DiagnosticsEngine::Error;
}
if (Ignoring()) {
if (Info.getID() == diag::warn_unused_expr
|| Info.getID() == diag::warn_unused_result
|| Info.getID() == diag::warn_unused_call
|| Info.getID() == diag::warn_unused_comparison)
return; // ignore!
if (Info.getID() == diag::warn_falloff_nonvoid_function) {
DiagLevel = DiagnosticsEngine::Error;
}
if (Info.getID() == diag::ext_return_has_expr) {
// An error that we need to suppress.
auto Diags = const_cast<DiagnosticsEngine*>(Info.getDiags());
Expand Down

0 comments on commit 3633810

Please sign in to comment.