[Bug libstdc++/105844] std::lcm(50000, 49999) is UB but accepted in a constexpr due to cast to unsigned
goswin-v-b at web dot de
gcc-bugzilla@gcc.gnu.org
Sat Jun 4 08:24:31 GMT 2022
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105844
--- Comment #3 from Goswin von Brederlow <goswin-v-b at web dot de> ---
Created attachment 53082
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53082&action=edit
Working patch for detecting UB
This will abort if the arguments are too large instead of static_assert, best I
could figure out that would work.
More information about the Gcc-bugs
mailing list