The following is compiled fine by gcc (12.1 and trunk), but clang (14.0.0 and trunk) gives an error on d.foo(), saying the call is ambiguous. Question is, to which compiler should I report a bug?
class Base
{
public:
void foo() {}
};
class Derived: public Base
{
public:
using Base::foo;
void foo() & {}
};
int main()
{
Derived d;
// Clang says here: error: call to member function 'foo' is ambiguous. Gcc,
// however, is fine with it
d.foo();
return 0;
}