summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/inherit/covariant11.C
blob: acba965f3af0983eb1e5c17d7d5a1827e7b46c6b (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
// { dg-do compile }

// Contributed by Nathan Sidwell 23 Oct 2003 <nathan@codesourcery.com>
// Origin: grigory@stl.sarov.ru
// PR c++/12700 ICE with covariancy

struct c2 { int i; };

struct c1 {
  virtual c2& f8() {}
};

struct c3 : c1, c2 {
  virtual c2& f8() {}
};

struct c11 : public c1 {
  virtual c3& f8() {}
};

struct c15 : virtual c3 {
  virtual c2& f8() {}
};

struct c18 : virtual c11 {
  virtual c15& f8();
};

c15& c18::f8() { throw 0; }