Commit 126c1ea1 by Jakub Jelinek Committed by Jakub Jelinek

re PR c++/53574 (ICE with -fstack-usage)

	PR c++/53574
	* g++.dg/other/pr53574.C: New test.

From-SVN: r253778
parent 6fba3d61
2017-10-16 Jakub Jelinek <jakub@redhat.com>
PR c++/53574
* g++.dg/other/pr53574.C: New test.
2017-10-16 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/61323
......
// 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); }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment