From 25c1b6cb3457e5c09793f2bb8c700e8230626975 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Thu, 22 Feb 2018 10:55:32 +0100 Subject: [PATCH] re PR c++/84496 (Internal compiler error with lambda, static and auto since r236615) PR c++/84496 * g++.dg/cpp1y/pr84496.C: New test. From-SVN: r257895 --- gcc/testsuite/ChangeLog | 3 ++ gcc/testsuite/g++.dg/cpp1y/pr84496.C | 44 ++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 gcc/testsuite/g++.dg/cpp1y/pr84496.C diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 681971b208e..161d5237040 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,8 @@ 2018-02-22 Jakub Jelinek + PR c++/84496 + * g++.dg/cpp1y/pr84496.C: New test. + PR target/84502 * g++.dg/torture/pr84502.C: New test. diff --git a/gcc/testsuite/g++.dg/cpp1y/pr84496.C b/gcc/testsuite/g++.dg/cpp1y/pr84496.C new file mode 100644 index 00000000000..028d00235cd --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1y/pr84496.C @@ -0,0 +1,44 @@ +// PR c++/84496 +// { dg-do compile { target c++14 } } + +template struct C { static constexpr T D = n; }; +struct E : C {}; +template struct F : C {}; +template T foo (); +template struct H { typedef int G; }; +template class I; +struct L; +template struct J; +template struct K; +struct R { + template + static J () (foo...)), L> o; +}; +template struct K : R { + typedef decltype (o) G; +}; +template +struct D : K::G>::D, P, Q...> {}; +template struct I

: D {}; +template class function; +template struct function { + template ::G> struct C; + template using U = int; + template , typename = U, void>> + function (P); +}; +template +template +function::function (P) +{ +} +void bar (function); + +void +baz () +{ + auto a = [] { + static int counter; + bar ([] (auto) { counter++; }); + }; +} -- 2.30.2