From 126c1ea158ebd9ecead98bb8ec61e55ba15d57eb Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Mon, 16 Oct 2017 10:36:06 +0200 Subject: [PATCH] re PR c++/53574 (ICE with -fstack-usage) PR c++/53574 * g++.dg/other/pr53574.C: New test. From-SVN: r253778 --- gcc/testsuite/ChangeLog | 5 +++ gcc/testsuite/g++.dg/other/pr53574.C | 48 ++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 gcc/testsuite/g++.dg/other/pr53574.C diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 3458692fcd3..e2104133d07 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2017-10-16 Jakub Jelinek + + PR c++/53574 + * g++.dg/other/pr53574.C: New test. + 2017-10-16 Paolo Carlini PR c++/61323 diff --git a/gcc/testsuite/g++.dg/other/pr53574.C b/gcc/testsuite/g++.dg/other/pr53574.C new file mode 100644 index 00000000000..cc899a552c8 --- /dev/null +++ b/gcc/testsuite/g++.dg/other/pr53574.C @@ -0,0 +1,48 @@ +// PR c++/53574 +// { dg-do compile { target c++11 } } +// { dg-options "-fstack-usage" } + +template struct A { typedef int type; }; +struct B { + typedef __SIZE_TYPE__ H; +}; +template class allocator : B {}; +template struct C { + template + static typename T::H foo(T *); + typedef decltype(foo((_Alloc *)0)) H; + template + static typename A::type bar(U) { return typename A::type (); } + static int baz(_Alloc p1) { bar(p1); return 0; } +}; +template struct I : C<_Alloc> {}; +template struct J { + typedef I> K; + K k; +}; +struct D : J> { + void fn(int, int) { + K m; + I::baz(m); + } +}; +template struct F { + F(); + F(const Ch *); + F test(); + D d; +}; +int l; +struct G { + G(F); +}; +char n; +template F::F(const Ch *) { + test(); +} +template +F F::test() { + d.fn(l, 0); + return F (); +} +G fn1() { return G(&n); } -- 2.30.2