llvmbot wrote:

<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: cor3ntin (cor3ntin)

<details>
<summary>Changes</summary>



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

``````````

</details>


https://github.com/llvm/llvm-project/pull/124593
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to