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