fork download
  1. #include <iostream>
  2.  
  3. void foo(int x, int y = 2, int z = 3) { }
  4. void foo(int x) { }
  5.  
  6. int main() {
  7. foo(1);
  8. return 0;
  9. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:7:10: error: call of overloaded ‘foo(int)’ is ambiguous
     foo(1);
          ^
prog.cpp:3:6: note: candidate: void foo(int, int, int)
 void foo(int x, int y = 2, int z = 3) {  }
      ^~~
prog.cpp:4:6: note: candidate: void foo(int)
 void foo(int x) {  }
      ^~~
stdout
Standard output is empty