Douglas Gregor | 4800d95 | 2010-02-11 19:21:55 +0000 | [diff] [blame] | 1 | // Matches |
Douglas Gregor | b203c9e | 2010-02-11 18:18:11 +0000 | [diff] [blame] | 2 | struct S0 { |
| 3 | int field1; |
| 4 | float field2; |
| 5 | }; |
| 6 | |
| 7 | struct S0 x0; |
| 8 | |
Douglas Gregor | 4800d95 | 2010-02-11 19:21:55 +0000 | [diff] [blame] | 9 | // Mismatch in field type |
Douglas Gregor | b203c9e | 2010-02-11 18:18:11 +0000 | [diff] [blame] | 10 | struct S1 { |
| 11 | int field1; |
| 12 | float field2; |
| 13 | }; |
| 14 | |
| 15 | struct S1 x1; |
Douglas Gregor | 4800d95 | 2010-02-11 19:21:55 +0000 | [diff] [blame] | 16 | |
| 17 | // Mismatch in tag kind. |
| 18 | union S2 { int i; float f; } x2; |
| 19 | |
| 20 | // Missing fields |
| 21 | struct S3 { int i; float f; } x3; |
| 22 | |
| 23 | // Extra fields |
| 24 | struct S4 { int i; float f; } x4; |
| 25 | |
| 26 | // Bit-field matches |
| 27 | struct S5 { int i : 8; unsigned j : 8; } x5; |
| 28 | |
| 29 | // Bit-field mismatch |
| 30 | struct S6 { int i : 8; unsigned j; } x6; |
| 31 | |
| 32 | // Bit-field mismatch |
| 33 | struct S7 { int i : 8; unsigned j : 16; } x7; |
Douglas Gregor | e72b5dc | 2010-02-12 00:09:27 +0000 | [diff] [blame] | 34 | |
| 35 | // Incomplete type |
| 36 | struct S8 { int i; float f; } *x8; |
| 37 | |
| 38 | // Incomplete type |
| 39 | struct S9 *x9; |
| 40 | |
| 41 | // Incomplete type |
| 42 | struct S10 *x10; |
Douglas Gregor | 5ce5dab | 2010-02-12 23:44:20 +0000 | [diff] [blame] | 43 | |
| 44 | // Matches |
| 45 | struct ListNode { |
| 46 | int value; |
| 47 | struct ListNode *Next; |
| 48 | } xList; |
Douglas Gregor | 73dc30b | 2010-02-15 22:01:00 +0000 | [diff] [blame^] | 49 | |
| 50 | // Mismatch due to struct used internally |
| 51 | struct DeepError { |
| 52 | int value; |
| 53 | struct DeeperError { int i; float f; } *Deeper; |
| 54 | } xDeep; |