Ensure __builtin_(add|sub|mul)_overflow return bool instead of void as per specification (LanguageExtensions).
Details
Diff Detail
- Repository
- rC Clang
Event Timeline
Can you write tests for this please? Particularly validate the results in a constexpr context.
Additionally, these all have the 't' flag, which means that these signatures are meaningless, right? What are you seeing where this works incorrectly?
There are already some tests for those builtins (not sure about constexpr context). They already tests that the builtins can be used as branching condition. However, the current implementation of Sema::BuildResolvedCallExpr assumes that by default builtins return bool. In https://reviews.llvm.org/D52879, I improve that and not having the above fix makes the existing tests fail, so I believe we don't need to add more tests.
Additionally, these all have the 't' flag, which means that these signatures are meaningless, right? What are you seeing where this works incorrectly?
I reckon the signature does't include the return type, hence it isn't meaningless even with the t flag.