Skip to content

Commit 66c9915

Browse files
committed
[clang][Interp][NFC] Remove from(Boolean) overload
This code is unused now that we have special casts from/to IntAP(S).
1 parent cbbb545 commit 66c9915

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

clang/lib/AST/Interp/IntegralAP.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ namespace interp {
2929
using APInt = llvm::APInt;
3030
using APSInt = llvm::APSInt;
3131
template <unsigned Bits, bool Signed> class Integral;
32-
class Boolean;
3332

3433
template <bool Signed> class IntegralAP final {
3534
private:
@@ -104,10 +103,6 @@ template <bool Signed> class IntegralAP final {
104103
assert(Copy.isSigned() == Signed);
105104
return IntegralAP<Signed>(Copy);
106105
}
107-
static IntegralAP from(const Boolean &B) {
108-
assert(false);
109-
return IntegralAP::zero();
110-
}
111106

112107
static IntegralAP zero() {
113108
assert(false);

clang/test/AST/Interp/intap.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ namespace i128 {
4242
// ref-note {{outside the range}}
4343
constexpr int128_t Two = (int128_t)1 << 1ul;
4444
static_assert(Two == 2, "");
45+
static_assert(Two, "");
46+
constexpr bool CastedToBool = Two;
47+
static_assert(CastedToBool, "");
4548

4649
constexpr uint128_t AllOnes = ~static_cast<uint128_t>(0);
4750
static_assert(AllOnes == UINT128_MAX, "");

0 commit comments

Comments
 (0)