Hi!

testsuite: Add testcase for bug fixed on trunk but not in 15/14 [PR124154]

This testcase used to be rejected before r16-970, but is accepted since
then.  It used to be rejected in 15.1 and 14.2 too, but PR120123
r15-9757 and r14-11823 backports started to ICE on it instead.
In 13/12 it is still rejected, so not a regression there.

I've committed the following to trunk to make sure we don't regress it.

2026-03-12  Jakub Jelinek  <[email protected]>

        PR c++/124154
        * g++.dg/cpp23/explicit-obj-lambda21.C: New test.

--- gcc/testsuite/g++.dg/cpp23/explicit-obj-lambda21.C.jj
+++ gcc/testsuite/g++.dg/cpp23/explicit-obj-lambda21.C
@@ -0,0 +1,8 @@
+// PR c++/124154
+// { dg-do compile { target c++23 } }
+
+struct S
+{
+  int x;
+  void foo () { auto l = [&] (this auto) { (void) x; }; l (); }
+};


        Jakub

Reply via email to