summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/torture/pr36960.C
blob: 280a6755d9577940c287d5869c98349ffc1fd3dc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// { dg-do run }

struct Lower {
    const int& ref;
    Lower(const int& ref) : ref(ref) { }
};
struct Middle : public virtual Lower {
    Middle(const int& ref) : Lower(ref) { }
};
struct Upper : public Middle {
    Upper(const int& ref) : Lower(ref), Middle(ref) { }
    int get() { return ref; }
};
extern "C" void abort (void);
int main()
{
  int i = 0;
  Upper upper(i);
  if (upper.get() != 0)
    abort ();
  return 0;
}