================
@@ -2888,7 +2888,9 @@ inline bool DoShift(InterpState &S, CodePtr OpPC, LT
&LHS, RT &RHS,
S.CCEDiag(Loc, diag::note_constexpr_negative_shift) << RHS.toAPSInt();
if (!S.noteUndefinedBehavior())
return false;
- RHS = -RHS;
+
+ RHS = RHS.isMin() ? RT(APSInt::getMaxValue(RHS.bitWidth(), false)) : -RHS;
----------------
hax0kartik wrote:
Nope, because
[IntegralAp](https://github.com/llvm/llvm-project/blob/a0e0775d91859d6ca32efc5fb8644b6281e98593/clang/lib/AST/ByteCode/IntegralAP.h)
class does not define a max method.
https://github.com/llvm/llvm-project/pull/176390
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits