On 5/14/25 3:43 AM, Simon Martin wrote:
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.
OK.
Successfully tested on x86_64-pc-linux-gnu.
PR c++/120126
gcc/testsuite/ChangeLog:
* g++.dg/cpp0x/lambda/lambda-ice33.C: New test.
---
gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice33.C | 12 ++++++++++++
1 file changed, 12 insertions(+)
create mode 100644 gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice33.C
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
index 00000000000..85642863530
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice33.C
@@ -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);
+}