[clang] [clang] Emit bad shift warnings (PR #70307)
Budimir Aranđelović via cfe-commits
cfe-commits at lists.llvm.org
Wed Mar 20 08:41:28 PDT 2024
================
@@ -2803,9 +2803,10 @@ static bool handleIntIntBinOp(EvalInfo &Info, const Expr *E, const APSInt &LHS,
// C++11 [expr.shift]p1: Shift width must be less than the bit width of
// the shifted type.
unsigned SA = (unsigned) RHS.getLimitedValue(LHS.getBitWidth()-1);
- if (SA != RHS) {
+ if (SA != RHS && Info.getLangOpts().CPlusPlus11) {
----------------
budimirarandjelovicsyrmia wrote:
As I didn't find valid reason, I reversed this change.
https://github.com/llvm/llvm-project/pull/70307
More information about the cfe-commits
mailing list