summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/inherit/error2.C
blob: 7d5e2e5d689fe940d4e4dc6e40d8b2005344d295 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// PR c++/28259
// { dg-do compile }

struct A
{
  virtual A* foo();    // { dg-error "overriding" }
};

struct B : virtual A;  // { dg-error "before" }

struct C : A
{
  virtual B* foo();    // { dg-error "invalid covariant" }
};

B* C::foo() { return 0; }