Skip to content

[Clang] fix test on 32 bits target after 561132e #124593

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
Jan 27, 2025
Merged
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
10 changes: 5 additions & 5 deletions clang/test/SemaCXX/cxx2b-consteval-propagate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -534,15 +534,15 @@ namespace GH123405 {
consteval void fn() {}

template <typename>
constexpr int tfn(int) {
constexpr auto tfn(int) {
auto p = &fn; // expected-note {{'tfn<int>' is an immediate function because its body evaluates the address of a consteval function 'fn'}}
return int(p); // expected-error {{cast from pointer to smaller type 'int' loses information}}
return p;
}

int g() {
void g() {
int a; // expected-note {{declared here}}
return tfn<int>(a); // expected-error {{call to immediate function 'GH123405::tfn<int>' is not a constant expression}}\
// expected-note {{read of non-const variable 'a' is not allowed in a constant expression}}
tfn<int>(a); // expected-error {{call to immediate function 'GH123405::tfn<int>' is not a constant expression}}\
// expected-note {{read of non-const variable 'a' is not allowed in a constant expression}}
}

}
Loading