summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/inherit/covariant16.C
blob: de9307e89315664771d4f78a661b6a9115f7e49b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/* PR c++/28253 This used to ICE. */
/* { dg-do compile } */

struct A
{
  virtual A* foo();
};

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

struct C : B
{
  virtual C& foo(); /* { dg-error "conflicting return type" } */
};