source:
tests/typedef.cfa
@
f2f22e3
Last change on this file since f2f22e3 was dc8511c, checked in by , 6 years ago | |
---|---|
|
|
File size: 747 bytes |
Rev | Line | |
---|---|---|
[51b7345] | 1 | typedef int T; |
2 | ||
3 | void f( void ) { | |
[c6b1105] | 4 | int T( T p ) { return 3; } |
[0b2961f] | 5 | T( 3 ); |
[51b7345] | 6 | } |
7 | ||
8 | struct { | |
[0b2961f] | 9 | T (T); |
[51b7345] | 10 | } fred = { 3 }; |
11 | ||
12 | typedef int (*a)(int, char); | |
13 | a b; | |
14 | ||
15 | int g(void) { | |
[0b2961f] | 16 | double a; |
[51b7345] | 17 | } |
18 | a c; | |
19 | ||
[e5b96bf] | 20 | typedef typeof(3) x, y; // GCC |
[51b7345] | 21 | |
[0b2961f] | 22 | x p; |
23 | y q; | |
[51b7345] | 24 | |
25 | int main() { | |
[e5b96bf] | 26 | typedef typeof(3) z, p; |
[0b2961f] | 27 | z w; |
28 | p x; | |
[51b7345] | 29 | } |
30 | ||
[a65d92e] | 31 | // new-style function definitions |
[51b7345] | 32 | |
33 | typedef [10] * int arrayOf10Pointers; | |
[0b2961f] | 34 | arrayOf10Pointers array; |
[51b7345] | 35 | typedef const * int constantPointer; |
36 | typedef * [ int ]( [] int ) funcPtr; | |
37 | typedef [ int ] funcProto( [] int ); | |
38 | typedef [ int, int ] tupleType; | |
39 | typedef * [ int, int ] tupleTypePtr; | |
[c6b1105] | 40 | typedef * int c, d; |
[51b7345] | 41 | typedef [ int ] f( * int ), g; |
42 | typedef [ * [static 10] int ] t; | |
[c6b1105] | 43 | typedef [ * [static 10] int x ] h(); |
[a65d92e] | 44 | |
45 | // Local Variables: // | |
46 | // tab-width: 4 // | |
47 | // End: // |
Note: See TracBrowser
for help on using the repository browser.