Skip to content

Commit

Permalink
[clang][Interp][NFC] Remove from(Boolean) overload
Browse files Browse the repository at this point in the history
This code is unused now that we have special casts from/to IntAP(S).
  • Loading branch information
tbaederr committed Oct 18, 2023
1 parent cbbb545 commit 66c9915
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
5 changes: 0 additions & 5 deletions clang/lib/AST/Interp/IntegralAP.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ namespace interp {
using APInt = llvm::APInt;
using APSInt = llvm::APSInt;
template <unsigned Bits, bool Signed> class Integral;
class Boolean;

template <bool Signed> class IntegralAP final {
private:
Expand Down Expand Up @@ -104,10 +103,6 @@ template <bool Signed> class IntegralAP final {
assert(Copy.isSigned() == Signed);
return IntegralAP<Signed>(Copy);
}
static IntegralAP from(const Boolean &B) {
assert(false);
return IntegralAP::zero();
}

static IntegralAP zero() {
assert(false);
Expand Down
3 changes: 3 additions & 0 deletions clang/test/AST/Interp/intap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<uint128_t>(0);
static_assert(AllOnes == UINT128_MAX, "");
Expand Down

0 comments on commit 66c9915

Please sign in to comment.