From f5918721eae31c1a9fb83b744f56fc8d0ddff59b Mon Sep 17 00:00:00 2001 From: jakub Date: Thu, 22 Feb 2018 09:55:32 +0000 Subject: [PATCH] PR c++/84496 * g++.dg/cpp1y/pr84496.C: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@257895 138bc75d-0d04-0410-961f-82ee72b054a4 --- 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.11.4.GIT