[PATCH] D142867: [Clang] Add machinery to catch overflow in unary minus outside of a constant expression context

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 30 11:41:13 PST 2023


aaron.ballman accepted this revision.
aaron.ballman added a comment.
This revision is now accepted and ready to land.

LGTM, though needs a release note.



================
Comment at: clang/lib/AST/ExprConstant.cpp:13503-13505
+    if (Value.isSigned() && Value.isMinSignedValue() && E->canOverflow()) {
+
+      if (Info.checkingForUndefinedBehavior())
----------------



CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D142867/new/

https://reviews.llvm.org/D142867



More information about the cfe-commits mailing list