namespace foo { struct type_t { int x; }; void bar( type_t & ); } void bar( foo::type_t & ); void func( void ) { foo::type_t x = { 10 }; bar(x); }
Standard input is empty
prog.cpp: In function ‘void func()’: prog.cpp:12: error: call of overloaded ‘bar(foo::type_t&)’ is ambiguous prog.cpp:8: note: candidates are: void bar(foo::type_t&) prog.cpp:5: note: void foo::bar(foo::type_t&)
Standard output is empty