| 1 |
/* This is allowed, with the effect that the 'extern' declaration at block |
| 2 |
scope refers to the same object as the 'static' declaration at file scope. |
| 3 |
|
| 4 |
C90 6.1.2.2 [as corrected by TC1], C99 6.2.2: |
| 5 |
|
| 6 |
For an identifier declared with the storage-class specifier |
| 7 |
extern in a scope in which a prior declaration of that |
| 8 |
identifier is visible, if the prior declaration specifies |
| 9 |
internal or external linkage, the linkage of the identifier at |
| 10 |
the later daclaration is the same as the linkage specified at |
| 11 |
the prior declaration. If no prior declaration is visible, |
| 12 |
or if the prior declaration specifies no linkage, then the |
| 13 |
identifier has external linkage. |
| 14 |
|
| 15 |
This is PR 14366. */ |
| 16 |
|
| 17 |
static int i; |
| 18 |
|
| 19 |
extern int i; |
| 20 |
|
| 21 |
static void f() { |
| 22 |
extern int i; |
| 23 |
} |