diff options
author | Gary Funck <gary@intrepid.com> | 2017-10-17 03:19:54 +0000 |
---|---|---|
committer | Gary Funck <gary@intrepid.com> | 2017-10-17 03:19:54 +0000 |
commit | 94de5b24eede2f2ed005b253a2c584675cd682d8 (patch) | |
tree | ac7aa645d5d9139bd11f7410e3654026e3e2cd44 /gcc/testsuite/g++.dg/other/pr53574.C | |
parent | 7af4e6706d969f6d2402e0a50473a70a9c85e5be (diff) | |
parent | 8905b0de50e8b67dda7c2e787c840720b98a637d (diff) |
Merge trunk version 253779 into gupc branch.gupc
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gupc@253802 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/g++.dg/other/pr53574.C')
-rw-r--r-- | gcc/testsuite/g++.dg/other/pr53574.C | 48 |
1 files changed, 48 insertions, 0 deletions
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 <typename> struct A { typedef int type; }; +struct B { + typedef __SIZE_TYPE__ H; +}; +template <typename> class allocator : B {}; +template <typename _Alloc> struct C { + template <typename T> + static typename T::H foo(T *); + typedef decltype(foo((_Alloc *)0)) H; + template <typename U> + static typename A<H>::type bar(U) { return typename A<H>::type (); } + static int baz(_Alloc p1) { bar(p1); return 0; } +}; +template <typename _Alloc> struct I : C<_Alloc> {}; +template <typename, typename> struct J { + typedef I<allocator<int>> K; + K k; +}; +struct D : J<int, allocator<int>> { + void fn(int, int) { + K m; + I<K>::baz(m); + } +}; +template <class Ch, class = int, class = int> struct F { + F(); + F(const Ch *); + F test(); + D d; +}; +int l; +struct G { + G(F<char>); +}; +char n; +template <class Ch, class Tr, class Alloc> F<Ch, Tr, Alloc>::F(const Ch *) { + test(); +} +template <class Ch, class Tr, class Alloc> +F<Ch, Tr, Alloc> F<Ch, Tr, Alloc>::test() { + d.fn(l, 0); + return F<Ch, Tr, Alloc> (); +} +G fn1() { return G(&n); } |