================
@@ -1964,6 +1964,53 @@ namespace I128Mul {
}
#endif
+namespace OverflowOps {
+ constexpr bool add_bool() {
+ bool r = false;
+ return __builtin_add_overflow(1u, 1u, &r) && r == false;
----------------
widberg wrote:
Personally, I would expect that to compile, as it does right now. At least
based on my understanding of the docs
https://clang.llvm.org/docs/LanguageExtensions.html#checked-arithmetic-builtins.
Also, GCC isn't happy because it explicitly forbids bools
(https://gcc.gnu.org/onlinedocs/gcc/Integer-Overflow-Builtins.html), whereas
Clang explicitly allows them.
https://github.com/llvm/llvm-project/pull/192568
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits