aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/other/pr52048.C
blob: 6bf51f1e28805253c75ee0b4f15eeb37ca2f18a5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
// PR debug/52048
// { dg-do compile }
// { dg-options "-fcompare-debug -fnon-call-exceptions -fno-tree-dominator-opts -O2" }

template <typename T> struct A;
template <typename T>
struct A <T *>
{
  typedef T &a;
};
template <typename T>
struct B
{
  typedef typename A <T>::a a;
  a operator *() {}
};
template <typename T, typename U>
bool operator != (B <T>, B <U>)
{
}
template <typename T>
struct C
{
  typedef T *c;
  template <typename>
  struct D { typedef C d; };
};
template <typename T, typename U> struct E
{
  typedef typename U::template D <T>::d e;
};
template <typename T, typename U = C <T> >
struct F
{
  typedef E <T, U> b;
  typedef typename b::e e;
  typedef typename e::c c;
  typedef B <c> i;
  i begin ();
  i end ();
};
class G;
class H;
struct I
{
  void *i;
  template <typename T> T foo ();
};
struct J : public I
{
  virtual bool bar ();
};
class K {};
struct L
{
  bool baz () {}
};
struct M
{
  K m1 (K);
  K m2 (H *) {}
};
struct N : J
{
  bool bar (G &);
};
bool
N::bar (G &)
{
  M m = foo <M> ();
  F <H *> f;
  for (F <H *>::i I = f.begin (), E = f.end (); I != E;)
    {
      H *h = *I;
      L l;
      if (l.baz ())
	m.m1 (m.m2 (h));
    }
}