[PR c++/84263] GC ICE with decltype
[official-gcc.git] / gcc / testsuite / g++.dg / parse / pr84263.C
blobe492d8c9e2573c858cda3131a6ac5903d45215da
1 // { dg-do compile { target c++11 } }
2 // { dg-additional-options "--param ggc-min-expand=0 --param ggc-min-heapsize=0" }
3 // PR 84263, a GC bug exposed on i686 native compiler (and possibly
4 // other 32-bit hosts).  decltype parsing could create a 
5 // pointer that would be gc-freed by later actions.
7 namespace std {
8 template <typename a> struct b {
9   int c;
10   a d;
12 template <typename> class g;
13 template <class> class initializer_list {
14   void *e;
15   __SIZE_TYPE__ f;
17 class h;
18 class j {
19   typedef b<h> i;
21 public:
22   j();
23   j(initializer_list<i>);
25 template <typename> struct m;
26 template <int k> struct m<char[k]> {};
27 class h {
28 public:
29   template <typename l> h(l &);
31 class G {
32   G();
33   j n;
35 G::G() { n = decltype(n){{0, ""}, {1, ".unoLineArrowEnd"}}; }