diff --git a/clang/lib/AST/Interp/IntegralAP.h b/clang/lib/AST/Interp/IntegralAP.h index a9e34a5b237a1..42f44354cbd25 100644 --- a/clang/lib/AST/Interp/IntegralAP.h +++ b/clang/lib/AST/Interp/IntegralAP.h @@ -210,7 +210,6 @@ template class IntegralAP final { } static bool comp(IntegralAP A, IntegralAP *R) { - assert(false); *R = IntegralAP(~A.V); return false; } diff --git a/clang/test/AST/Interp/literals.cpp b/clang/test/AST/Interp/literals.cpp index eca0e4c2cbd26..00182ba4ab1d9 100644 --- a/clang/test/AST/Interp/literals.cpp +++ b/clang/test/AST/Interp/literals.cpp @@ -52,6 +52,9 @@ namespace i128 { constexpr int128_t Two = (int128_t)1 << 1ul; static_assert(Two == 2, ""); + constexpr uint128_t AllOnes = ~static_cast(0); + static_assert(AllOnes == static_cast(-1), ""); + #if __cplusplus >= 201402L template constexpr T CastFrom(__int128_t A) {