From ef943ddcfa1f213c55c5894dbc43dcaebe1c4275 Mon Sep 17 00:00:00 2001 From: Javier Lopez-Gomez Date: Fri, 19 May 2023 15:55:35 +0200 Subject: [PATCH] Always promote `warn_falloff_nonvoid_function` to error 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 https://github.com/root-project/root/pull/12654, given that `IgnorePromptDiags` now defaults to 0 in `makeDefaultCompilationOptions()`. --- lib/Interpreter/IncrementalParser.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Interpreter/IncrementalParser.cpp b/lib/Interpreter/IncrementalParser.cpp index 4f44c6ca..1c84149a 100644 --- a/lib/Interpreter/IncrementalParser.cpp +++ b/lib/Interpreter/IncrementalParser.cpp @@ -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(Info.getDiags());