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

Jakub Jelinek jakub@gcc.gnu.org
Thu Mar 12 14:27:55 GMT 2026


https://gcc.gnu.org/g:d5d6631a961c8554a0b7aeb4360491532ce18cf2

commit r16-8042-gd5d6631a961c8554a0b7aeb4360491532ce18cf2
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Thu Mar 12 15:23:48 2026 +0100

    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.
    
    2026-03-12  Jakub Jelinek  <jakub@redhat.com>
    
            PR c++/124154
            * g++.dg/cpp23/explicit-obj-lambda21.C: New test.

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

diff --git a/gcc/testsuite/g++.dg/cpp23/explicit-obj-lambda21.C b/gcc/testsuite/g++.dg/cpp23/explicit-obj-lambda21.C
new file mode 100644
index 000000000000..73a32b643054
--- /dev/null
+++ b/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 (); }
+};


More information about the Gcc-cvs mailing list