Skip to content

Commit 2d4de5a

Browse files
authored
[clang][Interp] Implement IntegralAP::comp (#67954)
1 parent c0cb8f7 commit 2d4de5a

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

clang/lib/AST/Interp/IntegralAP.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,6 @@ template <bool Signed> class IntegralAP final {
210210
}
211211

212212
static bool comp(IntegralAP A, IntegralAP *R) {
213-
assert(false);
214213
*R = IntegralAP(~A.V);
215214
return false;
216215
}

clang/test/AST/Interp/literals.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ namespace i128 {
5252
constexpr int128_t Two = (int128_t)1 << 1ul;
5353
static_assert(Two == 2, "");
5454

55+
constexpr uint128_t AllOnes = ~static_cast<uint128_t>(0);
56+
static_assert(AllOnes == static_cast<uint128_t>(-1), "");
57+
5558
#if __cplusplus >= 201402L
5659
template <typename T>
5760
constexpr T CastFrom(__int128_t A) {

0 commit comments

Comments
 (0)