On Wed, Oct 08, 2025 at 04:09:05PM +0100, Jason Merrill wrote:
> I think it isn't worth bothering with that for this corner case; it's only
> needed in very rare cases.

Ok.

> But this is a general issue with if consteval that affects a lot of
> user/library code, and solving it more generally might be useful. Perhaps
> with an attribute on the "if consteval" statement?

You mean an attribute where the user (or more often libstdc++ author) would
kind of promise that if consteval is used sanely for something that yields
into the same behavior between both branches and essentially that
the if consteval then part is just more constant evaluation friendly copy
of what the else part does, with otherwise same result etc.?
I bet many libstdc++ if consteval uses are like that, but we'd need good
documentation on it.

        Jakub

Reply via email to