Re: [PATCH] c++: Fix up maybe_warn_for_constant_evaluated calls [PR114580]

2024-04-08 Thread Jason Merrill
On 4/5/24 14:47, Marek Polacek wrote: On Fri, Apr 05, 2024 at 09:40:48AM +0200, Jakub Jelinek wrote: Hi! When looking at maybe_warn_for_constant_evaluated for the trivial infinite loops patch, I've noticed that it can emit weird diagnostics for if constexpr in templates, first warn that std::is

Re: [PATCH] c++: Fix up maybe_warn_for_constant_evaluated calls [PR114580]

2024-04-05 Thread Marek Polacek
On Fri, Apr 05, 2024 at 09:40:48AM +0200, Jakub Jelinek wrote: > Hi! > > When looking at maybe_warn_for_constant_evaluated for the trivial > infinite loops patch, I've noticed that it can emit weird diagnostics > for if constexpr in templates, first warn that std::is_constant_evaluted() > always e

[PATCH] c++: Fix up maybe_warn_for_constant_evaluated calls [PR114580]

2024-04-05 Thread Jakub Jelinek
Hi! When looking at maybe_warn_for_constant_evaluated for the trivial infinite loops patch, I've noticed that it can emit weird diagnostics for if constexpr in templates, first warn that std::is_constant_evaluted() always evaluates to false (because the function template is not constexpr) and then