https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115740
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://gcc.gnu.org/bugzill | |a/show_bug.cgi?id=112882 --- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> --- std::clamp has undefined behavior if lo is greater than hi and that is why the assert is there. It has to be rejected at compile time for the undefined behavior with respect to constexpr. Adding constexpr would NOT reject the undefined behavior which is wrong for C++.