aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimm Bäder <tbaeder@redhat.com>2023-10-18 13:19:01 +0200
committerTimm Bäder <tbaeder@redhat.com>2023-10-18 14:23:29 +0200
commit66c99154a130553a50e499d898ef1fba5b755dcf (patch)
tree3affc5400f414deca6b162b62a15b236c6fdce49
parentcbbb545c4618969850d88bb008ab7f1c2918d5c3 (diff)
downloadllvm-66c99154a130553a50e499d898ef1fba5b755dcf.zip
llvm-66c99154a130553a50e499d898ef1fba5b755dcf.tar.gz
llvm-66c99154a130553a50e499d898ef1fba5b755dcf.tar.bz2
[clang][Interp][NFC] Remove from(Boolean) overload
This code is unused now that we have special casts from/to IntAP(S).
-rw-r--r--clang/lib/AST/Interp/IntegralAP.h5
-rw-r--r--clang/test/AST/Interp/intap.cpp3
2 files changed, 3 insertions, 5 deletions
diff --git a/clang/lib/AST/Interp/IntegralAP.h b/clang/lib/AST/Interp/IntegralAP.h
index f17fb8e..fd12094 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 <unsigned Bits, bool Signed> class Integral;
-class Boolean;
template <bool Signed> class IntegralAP final {
private:
@@ -104,10 +103,6 @@ public:
assert(Copy.isSigned() == Signed);
return IntegralAP<Signed>(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 f9cbc69..ef7a0d4 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<uint128_t>(0);
static_assert(AllOnes == UINT128_MAX, "");