================ @@ -256,28 +255,23 @@ template <bool Signed> class IntegralAP final { } private: - static bool CheckAddUB(const IntegralAP &A, const IntegralAP &B, - unsigned BitWidth, IntegralAP *R) { - if (!A.isSigned()) { - R->V = A.V + B.V; + template <template <typename T> class Op> + static bool CheckAddSubUB(const IntegralAP &A, const IntegralAP &B, + unsigned BitWidth, IntegralAP *R) { + if constexpr (!Signed) { + auto UOp = Op<APInt>(); + R->V = UOp(A.V, B.V); ---------------- AaronBallman wrote:
```suggestion R->V = Op<APInt>{}(A.V, B.V); ``` https://github.com/llvm/llvm-project/pull/71648 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits