virtualintf();// expected-note{{overridden virtual function is here}}
};
classB:A{
virtualvoidf();// expected-error{{virtual function 'f' has a different return type ('void') than the function it overrides (which has return type 'int')}}
virtualb*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 *')}}
virtuala*f();// expected-note{{overridden virtual function is here}}
};
classB:A{
virtualb*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')}}
};
}
namespaceT4{
structa{};
structa1:a{};
structb:a,a1{};
classA{
virtuala*f();// expected-note{{overridden virtual function is here}}
virtuala*constg();// expected-note{{overridden virtual function is here}}
};
classB:A{
virtuala*constf();
virtuala*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')}}
};
}
namespaceT6{
structa{};
classA{
virtualconsta*f();
virtuala*g();// expected-note{{overridden virtual function is here}}
};
classB:A{
virtuala*f();
virtualconsta*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 *'}}