]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
c++: another xobj lambda testcase [PR120123]
authorJason Merrill <jason@redhat.com>
Fri, 30 May 2025 22:27:45 +0000 (18:27 -0400)
committerJason Merrill <jason@redhat.com>
Fri, 30 May 2025 22:28:33 +0000 (18:28 -0400)
Patrick noticed this was fixed by r16-970.

PR c++/120123

gcc/testsuite/ChangeLog:

* g++.dg/cpp23/explicit-obj-lambda18.C: New test.

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

diff --git a/gcc/testsuite/g++.dg/cpp23/explicit-obj-lambda18.C b/gcc/testsuite/g++.dg/cpp23/explicit-obj-lambda18.C
new file mode 100644 (file)
index 0000000..21bd2e9
--- /dev/null
@@ -0,0 +1,13 @@
+// PR c++/120123
+// { dg-do compile { target c++23 } }
+
+struct H {
+    void member(int) {}
+    void call() {
+        [this]() {
+            [this](const auto& v)
+                requires requires { /*this->*/member(v); }
+            { return member(v); }(0);
+        };
+    }
+};