Overload resolution takes place after the compiler unambiguously finds a given function name. The following example demonstrates this:
struct A {
int f() { return 1; }
};
struct B {
int f(int arg) { return arg; }
};
struct C: A, B {
int g() { return f(); }
};
The compiler will not allow the function call to f() in C::g() because the name f has been declared both in A and B. The compiler detects the ambiguity error before overload resolution can select the base match A::f().
Related information