fork download
  1. namespace x {
  2. void foo() {}
  3. };
  4.  
  5. namespace y {
  6. void foo() {}
  7. };
  8.  
  9. using namespace x;
  10. using namespace y;
  11. using y::foo;
  12.  
  13. int main()
  14. {
  15. foo();
  16. }
  17.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
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()
stdout
Standard output is empty