[clang] 19f0524 - [Clang] fix test on 32 bits target after 561132e (#124593)

via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 27 09:30:54 PST 2025


Author: cor3ntin
Date: 2025-01-27T18:30:51+01:00
New Revision: 19f052443df05df373ef1c695055886db16de376

URL: https://github.com/llvm/llvm-project/commit/19f052443df05df373ef1c695055886db16de376
DIFF: https://github.com/llvm/llvm-project/commit/19f052443df05df373ef1c695055886db16de376.diff

LOG: [Clang] fix test on 32 bits target after 561132e (#124593)

Added: 
    

Modified: 
    clang/test/SemaCXX/cxx2b-consteval-propagate.cpp

Removed: 
    


################################################################################
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}}
 }
 
 }


        


More information about the cfe-commits mailing list