diff --git a/clang/lib/AST/Interp/IntegralAP.h b/clang/lib/AST/Interp/IntegralAP.h index f17fb8e484415..fd120944a2504 100644 --- a/clang/lib/AST/Interp/IntegralAP.h +++ b/clang/lib/AST/Interp/IntegralAP.h @@ -29,7 +29,6 @@ namespace interp { using APInt = llvm::APInt; using APSInt = llvm::APSInt; template class Integral; -class Boolean; template class IntegralAP final { private: @@ -104,10 +103,6 @@ template class IntegralAP final { assert(Copy.isSigned() == Signed); return IntegralAP(Copy); } - static IntegralAP from(const Boolean &B) { - assert(false); - return IntegralAP::zero(); - } static IntegralAP zero() { assert(false); diff --git a/clang/test/AST/Interp/intap.cpp b/clang/test/AST/Interp/intap.cpp index f9cbc698a3290..ef7a0d4f0dfda 100644 --- a/clang/test/AST/Interp/intap.cpp +++ b/clang/test/AST/Interp/intap.cpp @@ -42,6 +42,9 @@ namespace i128 { // ref-note {{outside the range}} constexpr int128_t Two = (int128_t)1 << 1ul; static_assert(Two == 2, ""); + static_assert(Two, ""); + constexpr bool CastedToBool = Two; + static_assert(CastedToBool, ""); constexpr uint128_t AllOnes = ~static_cast(0); static_assert(AllOnes == UINT128_MAX, "");