]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
c++: Add testcase for issue fixed in GCC 15 [PR120126]
authorSimon Martin <simon@nasilyan.com>
Wed, 14 May 2025 18:29:57 +0000 (20:29 +0200)
committerSimon Martin <simon@nasilyan.com>
Wed, 14 May 2025 18:59:13 +0000 (20:59 +0200)
Patrick noticed that this PR's testcase has been fixed by the patch for
PR c++/114292 (r15-7238-gceabea405ffdc8), more specifically the part
that walks the type of DECL_EXPR DECLs.

This simply adds the case to the testsuite.

PR c++/120126

gcc/testsuite/ChangeLog:

* g++.dg/cpp0x/lambda/lambda-ice33.C: New test.

gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice33.C [new file with mode: 0644]

diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice33.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice33.C
new file mode 100644 (file)
index 0000000..8564286
--- /dev/null
@@ -0,0 +1,12 @@
+// PR c++/120126
+// { dg-do compile { target c++11 } }
+
+template <typename... Args>
+int sum(Args... args) {
+  return [args...] { // { dg-error "parameter packs not expanded with" }
+    typename decltype(args)::type temp;
+  };
+}
+int main() {
+  sum(1, 10);
+}