[Bug libstdc++/115740] gcc-14.1.1: __glibcxx_assert_fail const-evaluation breaks clang/hip device code
pinskia at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Jul 1 23:12:45 GMT 2024
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++.
More information about the Gcc-bugs
mailing list