fork download
  1. int f();
  2. int f(); //fine, matches
  3. int f(int); //different signature, fine
  4. float f(); //error: return type does not match
  5.  
  6. class c;
  7. class c; //fine, matches
  8. struct c; //wrong: does not match
  9.  
  10. extern int x; //syntactically fine, but completely evil
  11. extern int x; //syntactically still fine, but still completely evil
  12. extern float x; //syntactically wrong, and just as evil
  13.  
  14. int main(){}
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:4:9: error: new declaration ‘float f()’
prog.cpp:2:5: error: ambiguates old declaration ‘int f()’
prog.cpp:12:14: error: conflicting declaration ‘float x’
prog.cpp:11:12: error: ‘x’ has a previous declaration as ‘int x’
stdout

Standard output is empty