-
Notifications
You must be signed in to change notification settings - Fork 623
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
C: fill properties for a function defined with a struct definition as…
… the return type of the function For the input like: static struct S {...} fn (...) { ... } the original code didn't fill the properties: field of fn with "static". Signed-off-by: Masatake YAMATO <[email protected]>
- Loading branch information
Showing
4 changed files
with
37 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--sort=no | ||
--kinds-c=* | ||
--fields=+x | ||
--fields-c=+{properties} |
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,5 @@ | ||
T input.c /^static struct T {int t;} f1(int i)$/;" s file: | ||
t input.c /^static struct T {int t;} f1(int i)$/;" m struct:T typeref:typename:int file: | ||
f1 input.c /^static struct T {int t;} f1(int i)$/;" f typeref:struct:T file: properties:static | ||
i input.c /^static struct T {int t;} f1(int i)$/;" z function:f1 typeref:typename:int file: | ||
r input.c /^ struct T r = {.t = i};$/;" l function:f1 typeref:struct:T file: |
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,9 @@ | ||
// See #3943. | ||
// static struct S {int s;} fS1(int i); | ||
|
||
/* This is invalid input as C++ code. */ | ||
static struct T {int t;} f1(int i) | ||
{ | ||
struct T r = {.t = i}; | ||
return r; | ||
} |
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