This revision was automatically updated to reflect the committed changes.
Closed by commit rL362157: Fix constexpr __builtin_*_overflow issue when
unsigned-signed operand. (authored by erichkeane, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
Changed
efriedma accepted this revision.
efriedma added a comment.
This revision is now accepted and ready to land.
LGTM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D62665/new/
https://reviews.llvm.org/D62665
___
cfe-commits mailing list
erichkeane updated this revision to Diff 202268.
erichkeane marked an inline comment as done.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D62665/new/
https://reviews.llvm.org/D62665
Files:
clang/lib/AST/ExprConstant.cpp
clang/test/SemaCXX/builtins-overflow.cpp
Index:
erichkeane marked an inline comment as done.
erichkeane added inline comments.
Comment at: clang/lib/AST/ExprConstant.cpp:9457
+ LHS = APSInt(LHS.isSigned() ? LHS.sextOrSelf(MaxBits)
+ : LHS.zextOrSelf(MaxBits),
efriedma added inline comments.
Comment at: clang/lib/AST/ExprConstant.cpp:9457
+ LHS = APSInt(LHS.isSigned() ? LHS.sextOrSelf(MaxBits)
+ : LHS.zextOrSelf(MaxBits),
!IsSigned);
Can you just write `LHS =
erichkeane created this revision.
erichkeane added reviewers: eli.friedman, efriedma, craig.topper.
As reported here https://bugs.llvm.org/show_bug.cgi?id=42000, it was
possible to get the constexpr version of __builtin_*_overflow to give
the wrong answer.
This was because when extending the