================ @@ -195,13 +196,23 @@ static bool CanElideOverflowCheck(const ASTContext &Ctx, const BinOpInfo &Op) { if (!Op.mayHaveIntegerOverflow()) return true; + const UnaryOperator *UO = dyn_cast<UnaryOperator>(Op.E); + + if (UO && UO->getOpcode() == UO_Minus && UO->isIntegerConstantExpr(Ctx) && + Ctx.getLangOpts().isOverflowPatternExcluded( + LangOptions::OverflowPatternExclusionKind::NegUnsignedConst)) ---------------- JustinStitt wrote:
Nice catch, resolved in https://github.com/llvm/llvm-project/pull/100272/commits/cb0fcd1c3b1ded7258bb20cff4d187ca56f17149 https://github.com/llvm/llvm-project/pull/100272 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits