-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Still not really perfect and has some other issues still, so still draft for now
- Loading branch information
Showing
6 changed files
with
88 additions
and
10 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
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
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
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,13 @@ | ||
typedef struct test { | ||
int a; | ||
int b; | ||
} S; | ||
|
||
int structs() { | ||
S s; | ||
S t; | ||
S* p=&s; | ||
s.a=1; | ||
s.b=2; | ||
printf("%d %d\n", s.a, s.b); | ||
} |
15 changes: 15 additions & 0 deletions
15
cpg-language-cxx/src/test/resources/cxx/typedef_struct.cpp
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,15 @@ | ||
typedef struct test { | ||
int a; | ||
int b; | ||
} S; | ||
|
||
int structs() { | ||
S s; | ||
S t; | ||
S* p=&s; | ||
s.a=1; | ||
s.b=2; | ||
printf("%d %d\n", s.a, s.b); | ||
} | ||
|
||
long typedef bla; |
14 changes: 14 additions & 0 deletions
14
cpg-language-cxx/src/test/resources/typedefs/weird_typedefs.cpp
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,14 @@ | ||
// typedef can be used anywhere in the decl-specifier-seq | ||
// more conventionally spelled "typedef unsigned long long int ullong;" | ||
unsigned long typedef long int ullong; | ||
|
||
// also possible with structs | ||
struct bar { | ||
int a; | ||
int b; | ||
} typedef baz; | ||
|
||
// just some type that contains a typedef for more confusion | ||
struct foo { | ||
typedef const int a; | ||
}; |