namespace A
{
void std();
void foo()
{
std::cout << "Hello World";
}
};
In (1), stdit cannot name a function, therefore the function is A::stdignored during the search, but compiles the code .
This rule is explicitly mentioned in [basic.lookup.qual] / 1:
:: - decltype, , :: , , - .
class A : B {};
B , , B, .
class A a;
A .