1 | // RUN: %clang_cc1 %s -fsyntax-only -verify |
2 | // expected-no-diagnostics |
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 | |
30 | |