-
Notifications
You must be signed in to change notification settings - Fork 620
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3621 from masatake/cxx--typeof
Cxx: support typeof and __typeof__ keywords of the gcc extension
- Loading branch information
Showing
10 changed files
with
122 additions
and
11 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,5 @@ | ||
--sort=no | ||
--param-CPreProcessor._expand=true | ||
--fields-C=+{macrodef} | ||
--fields=+{signature} | ||
--kinds-C=+x |
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 @@ | ||
__attribute_copy__ input.c /^# define __attribute_copy__(/;" d file: signature:(arg) macrodef:__attribute__ ((__copy__ (arg))) | ||
weak_alias input.c /^# define weak_alias(name, aliasname) _weak_alias /;" d file: signature:(name,aliasname) macrodef:_weak_alias (name, aliasname) | ||
_weak_alias input.c /^# define _weak_alias(/;" d file: signature:(name,aliasname) macrodef:extern __typeof (name) aliasname __attribute__ ((weak, alias (#name))) __attribute_copy__ (name); | ||
__brk input.c /^__brk (void *addr)$/;" f typeref:typename:int signature:(void * addr) | ||
brk input.c /^weak_alias (__brk, brk)$/;" x typeref:typename:__typeof(__brk) |
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 @@ | ||
// Derrived from glibc | ||
# define __attribute_copy__(arg) __attribute__ ((__copy__ (arg))) | ||
# define weak_alias(name, aliasname) _weak_alias (name, aliasname) | ||
# define _weak_alias(name, aliasname) \ | ||
extern __typeof (name) aliasname __attribute__ ((weak, alias (#name))) \ | ||
__attribute_copy__ (name); | ||
|
||
int | ||
__brk (void *addr) | ||
{ | ||
/* ... */ | ||
return 0; | ||
} | ||
weak_alias (__brk, brk) |
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,2 @@ | ||
--sort=no | ||
--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,17 @@ | ||
a input.cxx /^int a;$/;" v typeref:typename:int | ||
b input.cxx /^decltype(a) b;$/;" v typeref:typename:decltype(a) | ||
c input.cxx /^typeof(a) c;$/;" v typeref:typename:typeof(a) | ||
d input.cxx /^__typeof__(a) d;$/;" v typeref:typename:__typeof__(a) | ||
d0 input.cxx /^__typeof(a) d0;$/;" v typeref:typename:__typeof(a) | ||
e input.cxx /^decltype(a) const e = 1;$/;" v typeref:typename:decltype(a) const | ||
f input.cxx /^typeof(a) const f = 2;$/;" v typeref:typename:typeof(a) const | ||
g input.cxx /^__typeof__(a) const g = 3;$/;" v typeref:typename:__typeof__(a) const | ||
g0 input.cxx /^__typeof(a) const g0 = 3;$/;" v typeref:typename:__typeof(a) const | ||
h input.cxx /^static decltype(a) const h = 4;$/;" v typeref:typename:decltype(a) const file: properties:static | ||
i input.cxx /^static typeof(a) const i = 5;$/;" v typeref:typename:typeof(a) const file: properties:static | ||
j input.cxx /^static __typeof__(a) const j = 6;$/;" v typeref:typename:__typeof__(a) const file: properties:static | ||
j0 input.cxx /^static __typeof(a) const j0 = 6;$/;" v typeref:typename:__typeof(a) const file: properties:static | ||
k input.cxx /^static const decltype(a) k = 7;$/;" v typeref:typename:const decltype(a) file: properties:static | ||
l input.cxx /^static const typeof(a) l = 8;$/;" v typeref:typename:const typeof(a) file: properties:static | ||
m input.cxx /^static const __typeof__(a) m = 9;$/;" v typeref:typename:const __typeof__(a) file: properties:static | ||
m0 input.cxx /^static const __typeof(a) m0 = 10;$/;" v typeref:typename:const __typeof(a) file: properties:static |
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,21 @@ | ||
int a; | ||
|
||
decltype(a) b; | ||
typeof(a) c; | ||
__typeof__(a) d; | ||
__typeof(a) d0; | ||
|
||
decltype(a) const e = 1; | ||
typeof(a) const f = 2; | ||
__typeof__(a) const g = 3; | ||
__typeof(a) const g0 = 3; | ||
|
||
static decltype(a) const h = 4; | ||
static typeof(a) const i = 5; | ||
static __typeof__(a) const j = 6; | ||
static __typeof(a) const j0 = 6; | ||
|
||
static const decltype(a) k = 7; | ||
static const typeof(a) l = 8; | ||
static const __typeof__(a) m = 9; | ||
static const __typeof(a) m0 = 10; |
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