[
Note 6:
If name lookup finds a declaration for a name in two different
namespaces, and the declarations do not declare the same entity and do
not declare functions or function templates, the use of the name is ill-formed (
[basic.lookup])
. In particular, the name of a variable, function or enumerator does not
hide the name of a class or enumeration declared in a different
namespace
. For example,
namespace A {
class X { };
extern "C" int g();
extern "C++" int h();
}
namespace B {
void X(int);
extern "C" int g();
extern "C++" int h(int);
}
using namespace A;
using namespace B;
void f() {
X(1);
g();
h();
}
—
end note]