https://gcc.gnu.org/g:6fda31f7b3f133a31e0a7179a82fe73b081ebbc5

commit r16-4114-g6fda31f7b3f133a31e0a7179a82fe73b081ebbc5
Author: Jason Merrill <[email protected]>
Date:   Fri Sep 26 13:51:33 2025 +0100

    c++: add testcase [PR121854]
    
    Add the testcase for this GCC 15 PR, already fixed on trunk by r16-970.
    
            PR c++/121854
    
    gcc/testsuite/ChangeLog:
    
            * g++.dg/cpp23/explicit-obj-lambda19.C: New test.

Diff:
---
 gcc/testsuite/g++.dg/cpp23/explicit-obj-lambda19.C | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/gcc/testsuite/g++.dg/cpp23/explicit-obj-lambda19.C 
b/gcc/testsuite/g++.dg/cpp23/explicit-obj-lambda19.C
new file mode 100644
index 000000000000..bbf295cddf88
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp23/explicit-obj-lambda19.C
@@ -0,0 +1,15 @@
+// PR c++/121854
+// { dg-do compile { target c++23 } }
+
+struct S
+{
+    static void static_func(){}
+
+    void func()
+    {
+        auto lambda = [](this auto)
+        {
+            static_func();
+        };
+    }
+};

Reply via email to