fork download
  1. #include <iostream>
  2.  
  3. void bar(int){}
  4.  
  5. struct Foo{
  6. void bar(){}
  7. void test(){
  8. bar(42);
  9. }
  10. };
  11.  
  12. int main() {
  13. Foo{}.test();
  14. }
Compilation error #stdin compilation error #stdout 0s 3460KB
stdin
Standard input is empty
compilation info
prog.cpp: In member function 'void Foo::test()':
prog.cpp:8:9: error: no matching function for call to 'Foo::bar(int)'
   bar(42);
         ^
prog.cpp:6:7: note: candidate: void Foo::bar()
  void bar(){}
       ^
prog.cpp:6:7: note:   candidate expects 0 arguments, 1 provided
stdout
Standard output is empty