================ @@ -44,6 +44,24 @@ static_assert(MulA * MulB == 50, ""); // ref-error {{not an integral constant ex static_assert(MulA * 5 == 25, ""); static_assert(-1 * MulB == -7, ""); + +constexpr _BitInt(4) DivA = 2; +constexpr _BitInt(2) DivB = 1; +static_assert(DivA / DivB == 2, ""); + +constexpr _BitInt(4) DivC = DivA / 0; // ref-error {{must be initialized by a constant expression}} \ ---------------- AaronBallman wrote:
I meant `int`; basically, it's catching the other form of UB that's not division by zero. https://github.com/llvm/llvm-project/pull/72614 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits