https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120720

--- Comment #4 from Simon H. <sh1.gccbug at tikouka dot nz> ---
Indeed, not JUST constexpr.

But I tried substituting in std::max() and had the same problem with the
constexpr side of things -- that I cannot implement a constexpr function which
relies on it.  I'm sure folding works just fine in that case, but evidently
it's not legal C++ (or maybe it's fixed in a version I didn't test).

I suppose constexpr std::max() is a C++ standards body problem, not a GCC
problem, but it is still a problem and by extension many builtins probably
should also be elevated to constexpr whenever they're able to be folded.

Is that a separate bug to be filed?  I don't feel qualified to do so because it
probably involves enumerating all sorts of builtins and contemplating which of
them should be changed.

Reply via email to