namespace x { void foo() {} }; namespace y { void foo() {} }; using namespace x; using namespace y; using y::foo; int main() { foo(); }
Standard input is empty
prog.cpp: In function ‘int main()’: prog.cpp:15:9: error: call of overloaded ‘foo()’ is ambiguous prog.cpp:15:9: note: candidates are: prog.cpp:6:10: note: void y::foo() prog.cpp:2:10: note: void x::foo()
Standard output is empty