-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
19 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
tests/test_data/invalid_semantics/name_resolution/redefined_parameter.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
int foo(int a) | ||
{ | ||
/* A function's parameter list and its body are in the same scope, | ||
* so redeclaring a here is illegal. */ | ||
int a = 5; | ||
return a; | ||
} | ||
|
||
int main(void) | ||
{ | ||
return foo(3); | ||
} |
4 changes: 4 additions & 0 deletions
4
tests/test_data/invalid_semantics/name_resolution/redefined_parameter.stderr.approved.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{{filename}}:3:7: Error: redefinition of 'a' | ||
3 | int a = 5; | ||
| ^ | ||
|