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

Eli Friedman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu May 30 11:49:30 PDT 2019


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 = APSInt(LHS.extOrTrunc(MaxBits), !IsSigned);`, or something like that?  


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

https://reviews.llvm.org/D62665





More information about the cfe-commits mailing list