Fariborz Jahanian | d97f558 | 2011-03-23 19:50:54 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 %s -fsyntax-only -verify |
Andy Gibbs | 8e8fb3b | 2012-10-19 12:44:48 +0000 | [diff] [blame] | 2 | // expected-no-diagnostics |
Fariborz Jahanian | d97f558 | 2011-03-23 19:50:54 +0000 | [diff] [blame] | 3 | // rdar:// 9129552 |
| 4 | // PR9406 |
| 5 | |
| 6 | typedef struct { |
| 7 | char *str; |
| 8 | char *str2; |
| 9 | } Class; |
| 10 | |
| 11 | typedef union { |
| 12 | Class *object; |
| 13 | } Instance __attribute__((transparent_union)); |
| 14 | |
| 15 | __attribute__((overloadable)) void Class_Init(Instance this, char *str, void *str2) { |
| 16 | this.object->str = str; |
| 17 | this.object->str2 = str2; |
| 18 | } |
| 19 | |
| 20 | __attribute__((overloadable)) void Class_Init(Instance this, char *str) { |
| 21 | this.object->str = str; |
| 22 | this.object->str2 = str; |
| 23 | } |
| 24 | |
| 25 | int main(void) { |
| 26 | Class obj; |
| 27 | Class_Init(&obj, "Hello ", " World"); |
| 28 | } |
| 29 | |