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

Conversation

cor3ntin
Copy link
Contributor

No description provided.

@llvmbot llvmbot added the clang Clang issues not falling into any other category label Jan 27, 2025
@llvmbot
Copy link
Member

llvmbot commented Jan 27, 2025

@llvm/pr-subscribers-clang

Author: cor3ntin (cor3ntin)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/124593.diff

1 Files Affected:

  • (modified) clang/test/SemaCXX/cxx2b-consteval-propagate.cpp (+5-5)
diff --git a/clang/test/SemaCXX/cxx2b-consteval-propagate.cpp b/clang/test/SemaCXX/cxx2b-consteval-propagate.cpp
index 222d482f40aa5d..868a52c3572414 100644
--- a/clang/test/SemaCXX/cxx2b-consteval-propagate.cpp
+++ b/clang/test/SemaCXX/cxx2b-consteval-propagate.cpp
@@ -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}}
 }
 
 }

@cor3ntin cor3ntin merged commit 19f0524 into llvm:main Jan 27, 2025
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang Clang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants