https://bugs.llvm.org/show_bug.cgi?id=41552

            Bug ID: 41552
           Summary: different result from __builtin_add_overflow in
                    constant expresion
           Product: clang
           Version: 7.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected], [email protected],
                    [email protected]

Description:
Normally, when passing a combination of large signed and unsigned integer
values to the generic overload of __builtin_add_overflow and requesting back an
unsigned integer, the function correctly identifies overflow. When the same
operation takes place in a constant expression, __builtin_add_overflow fails to
identify that the overflow took place.

Example:
https://wandbox.org/permlink/hDCXNEThgH3NmdLz

Affected:
This affects 7.x and upward. Earlier versions do not support
__builtin_add_overflow in constant expressions. 
This affects C++14 and later. A repro for C++11 is not possible due to
limitations imposed on constexpr fns.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to