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

struct A {};

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

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

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

struct D : C {};