[PATCH] D62665: Fix constexpr __builtin_*_overflow issue when unsigned->signed operand.

2019-05-30 Thread Erich Keane via Phabricator via cfe-commits
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

[PATCH] D62665: Fix constexpr __builtin_*_overflow issue when unsigned->signed operand.

2019-05-30 Thread Eli Friedman via Phabricator via cfe-commits
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

[PATCH] D62665: Fix constexpr __builtin_*_overflow issue when unsigned->signed operand.

2019-05-30 Thread Erich Keane via Phabricator via cfe-commits
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:

[PATCH] D62665: Fix constexpr __builtin_*_overflow issue when unsigned->signed operand.

2019-05-30 Thread Erich Keane via Phabricator via cfe-commits
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),

[PATCH] D62665: Fix constexpr __builtin_*_overflow issue when unsigned->signed operand.

2019-05-30 Thread Eli Friedman via Phabricator via cfe-commits
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 =

[PATCH] D62665: Fix constexpr __builtin_*_overflow issue when unsigned->signed operand.

2019-05-30 Thread Erich Keane via Phabricator via cfe-commits
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