summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/opt/ice1.C
blob: 701897166f51936588f3401e8a5aafdd1df14772 (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
// PR c++/43024
// { dg-options "-O2" }

void foo();

template<int> struct X
{
  enum { e };
  typedef int Y;
};

template<int N = 0> struct A
{
  ~A() { foo(); }
  A() { a<0>(0); }
  template<int> void a(typename X<!X<N>::e>::Y);
  struct B b();
};

struct B
{
  A<> b0, b1, b2, b3;
  B operator+ (const B&);
};

struct C
{
  A<> c0, c1, c2, c3, c4, c5, c6, c7, c8;
};

inline void bar(int i)
{
  A<> a0, a1;
  if (i) a0.b() + a0.b() + a0.b() + a0.b();
}

void baz()
{
  C c;
  bar(0);
}