language: C++11 (gcc-4.7.2)
date: 140 days 0 hours ago
link:
visibility: public
1
2
3
4
5
6
7
8
9
10
11
12
13
14
int f();
int f(); //fine, matches
int f(int); //different signature, fine
float f(); //error: return type does not match
 
class c;
class c; //fine, matches
struct c; //wrong: does not match
 
extern int x; //syntactically fine, but completely evil
extern int x; //syntactically still fine, but still completely evil
extern float x; //syntactically wrong, and just as evil 
 
int main(){}
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’