From: Paolo Carlini Date: Fri, 9 Feb 2018 11:37:14 +0000 (+0000) Subject: re PR c++/77522 (ICE on invalid code C++14 code: in tsubst_decl, at cp/pt.c:12447) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0805a34d5f2a42052452ccc3ea45fde7975ff417;p=gcc.git re PR c++/77522 (ICE on invalid code C++14 code: in tsubst_decl, at cp/pt.c:12447) 2018-02-09 Paolo Carlini PR c++/77522 * g++.dg/cpp1y/lambda-init16.C: New. From-SVN: r257521 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 544ebefe0b6..ff8136e2234 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-02-09 Paolo Carlini + + PR c++/77522 + * g++.dg/cpp1y/lambda-init16.C: New. + 2018-02-09 Eric Botcazou * gnat.dg/sso8.adb: New test. diff --git a/gcc/testsuite/g++.dg/cpp1y/lambda-init16.C b/gcc/testsuite/g++.dg/cpp1y/lambda-init16.C new file mode 100644 index 00000000000..0a40ebbee0f --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1y/lambda-init16.C @@ -0,0 +1,13 @@ +// PR c++/77522 +// { dg-do compile { target c++14 } } + +template < class T = int > void f (T) +{ + auto g = [&a = f] () {}; // { dg-error "invalid initialization" } +} + +int main () +{ + f (0); + return 0; +}