From: Paolo Carlini Date: Thu, 7 Mar 2019 20:49:42 +0000 (+0000) Subject: re PR c++/84518 (ICE with lambda capturing broken variable) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c7163b643e48094f4a7e97c158cb11ca8560257b;p=gcc.git re PR c++/84518 (ICE with lambda capturing broken variable) 2019-03-07 Paolo Carlini PR c++/84518 * g++.dg/cpp0x/lambda/lambda-ice30.C: New. * g++.dg/cpp0x/lambda/lambda-ice31.C: Likewise. From-SVN: r269469 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index e2b22ba5436..0a90257aa56 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2019-03-07 Paolo Carlini + + PR c++/84518 + * g++.dg/cpp0x/lambda/lambda-ice30.C: New. + * g++.dg/cpp0x/lambda/lambda-ice31.C: Likewise. + 2019-03-07 Jakub Jelinek PR translation/79999 diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice30.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice30.C new file mode 100644 index 00000000000..46350bd1d52 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice30.C @@ -0,0 +1,13 @@ +// PR c++/84518 +// { dg-do compile { target c++11 } } + +template void foo() +{ + int x[=]; // { dg-error "expected" } + [&x]{}; +} + +void bar() +{ + foo<0>(); +} diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice31.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice31.C new file mode 100644 index 00000000000..54ded7bb282 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice31.C @@ -0,0 +1,8 @@ +// PR c++/84518 +// { dg-do compile { target c++11 } } + +template void foo() +{ + T x[=]; // { dg-error "expected" } + [&x]{}; +}