From e86f32c088263317a3d74cbdf242381743a22dcd Mon Sep 17 00:00:00 2001 From: jason Date: Tue, 20 Feb 2018 03:39:37 +0000 Subject: PR c++/84429 - ICE capturing VLA. * lambda.c (build_capture_proxy): Handle reference refs. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@257836 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/testsuite/g++.dg/cpp0x/lambda/lambda-vla1.C | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 gcc/testsuite/g++.dg/cpp0x/lambda/lambda-vla1.C (limited to 'gcc/testsuite/g++.dg/cpp0x/lambda') diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-vla1.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-vla1.C new file mode 100644 index 00000000000..91498c4589a --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-vla1.C @@ -0,0 +1,9 @@ +// PR c++/84429 +// { dg-do compile { target c++11 } } +// { dg-options "" } + +void foo(int i) +{ + char x[i]; + [&]{ [&]{ return x; }; }; +} -- cgit v1.2.1 From 16335c27fa0e14c544942c9205f15271460e6688 Mon Sep 17 00:00:00 2001 From: jakub Date: Tue, 20 Feb 2018 08:20:37 +0000 Subject: PR c++/84455 * pt.c (tsubst_lambda_expr): If not nested, increment temporarily function_depth to avoid GC during finish_lambda_function. * g++.dg/cpp0x/lambda/lambda-ice26.C: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@257838 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice26.C | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice26.C (limited to 'gcc/testsuite/g++.dg/cpp0x/lambda') diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice26.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice26.C new file mode 100644 index 00000000000..7544b270256 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice26.C @@ -0,0 +1,5 @@ +// PR c++/84455 +// { dg-do compile { target c++11 } } +// { dg-options "--param ggc-min-heapsize=0" } + +#include "lambda-ice14.C" -- cgit v1.2.1 From 120a74e2ef9721677aa6858cd08c67a5cfefc8a9 Mon Sep 17 00:00:00 2001 From: paolo Date: Tue, 20 Feb 2018 09:02:12 +0000 Subject: /cp 2018-02-20 Paolo Carlini PR c++/84446 * parser.c (cp_parser_init_declarator): Don't call start_lambda_scope on error_mark_node. /testsuite 2018-02-20 Paolo Carlini PR c++/84446 * g++.dg/cpp0x/lambda/lambda-ice27.C: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@257841 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice27.C | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice27.C (limited to 'gcc/testsuite/g++.dg/cpp0x/lambda') diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice27.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice27.C new file mode 100644 index 00000000000..04c44a3b57f --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice27.C @@ -0,0 +1,8 @@ +// PR c++/84446 +// { dg-do compile { target c++11 } } + +template void foo() +{ + int i, + i = [] { virtual }(); // { dg-error "redeclaration|expected" } +} -- cgit v1.2.1