]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
c++: add testcase [PR121854]
authorJason Merrill <jason@redhat.com>
Fri, 26 Sep 2025 12:51:33 +0000 (13:51 +0100)
committerJason Merrill <jason@redhat.com>
Sat, 27 Sep 2025 08:06:21 +0000 (09:06 +0100)
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.

gcc/testsuite/g++.dg/cpp23/explicit-obj-lambda19.C [new file with mode: 0644]

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 (file)
index 0000000..bbf295c
--- /dev/null
@@ -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();
+        };
+    }
+};