Skip to content

[clang][Interp] Implement IntegralAP::comp #67954

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion clang/lib/AST/Interp/IntegralAP.h
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,6 @@ template <bool Signed> class IntegralAP final {
}

static bool comp(IntegralAP A, IntegralAP *R) {
assert(false);
*R = IntegralAP(~A.V);
return false;
}
Expand Down
3 changes: 3 additions & 0 deletions clang/test/AST/Interp/literals.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ namespace i128 {
constexpr int128_t Two = (int128_t)1 << 1ul;
static_assert(Two == 2, "");

constexpr uint128_t AllOnes = ~static_cast<uint128_t>(0);
static_assert(AllOnes == static_cast<uint128_t>(-1), "");

#if __cplusplus >= 201402L
template <typename T>
constexpr T CastFrom(__int128_t A) {
Expand Down