Fixed visibility of undeclared functions and objects.
This commit is contained in:
15
test/err/bug2304-var-use.c
Normal file
15
test/err/bug2304-var-use.c
Normal file
@@ -0,0 +1,15 @@
|
||||
/* Bug 2304 - Visibility of objects/functions undeclared in file scope but 'extern'-declared in unrelated block scopes */
|
||||
|
||||
void f1(void)
|
||||
{
|
||||
extern int a;
|
||||
}
|
||||
|
||||
/* 'a' is still invisible in the file scope */
|
||||
|
||||
int main(void)
|
||||
{
|
||||
return a * 0; /* Usage of 'a' should be an error */
|
||||
}
|
||||
|
||||
int a = 42;
|
||||
Reference in New Issue
Block a user