1 // RUN: clang-cc -fsyntax-only -faccess-control -verify %s
6 virtual int f(); // expected-note{{overridden virtual function is here}}
10 virtual void f(); // expected-error{{virtual function 'f' has a different return type ('void') than the function it overrides (which has return type 'int')}}
21 virtual a* f(); // expected-note{{overridden virtual function is here}}
25 virtual b* f(); // expected-error{{return type of virtual function 'f' is not covariant with the return type of the function it overrides ('struct T2::b *' is not derived from 'struct T2::a *')}}
33 struct b : private a { }; // expected-note{{'private' inheritance specifier here}}
36 virtual a* f(); // expected-note{{overridden virtual function is here}}
40 virtual b* f(); // expected-error{{return type of virtual function 'f' is not covariant with the return type of the function it overrides (conversion from 'struct T3::b' to inaccessible base class 'struct T3::a')}}
52 virtual a* f(); // expected-note{{overridden virtual function is here}}
56 virtual b* f(); // expected-error{{return type of virtual function 'f' is not covariant with the return type of the function it overrides (ambiguous conversion from derived class 'struct T4::b' to base class 'struct T4::a':\n\
57 struct T4::b -> struct T4::a\n\
58 struct T4::b -> struct T4::a1 -> struct T4::a)}}
69 virtual a* const g(); // expected-note{{overridden virtual function is here}}
74 virtual a* g(); // expected-error{{return type of virtual function 'g' is not covariant with the return type of the function it overrides ('struct T5::a *' has different qualifiers than 'struct T5::a *const')}}
85 virtual a* g(); // expected-note{{overridden virtual function is here}}
90 virtual const a* g(); // expected-error{{return type of virtual function 'g' is not covariant with the return type of the function it overrides (class type 'struct T6::a const *' is more qualified than class type 'struct T6::a *'}}