blob: acdc5898b026f14de600d09e4d1b1967a98a0338 [file] [log] [blame]
Fariborz Jahaniand97f5582011-03-23 19:50:54 +00001// RUN: %clang_cc1 %s -fsyntax-only -verify
Andy Gibbs8e8fb3b2012-10-19 12:44:48 +00002// expected-no-diagnostics
Fariborz Jahaniand97f5582011-03-23 19:50:54 +00003// rdar:// 9129552
4// PR9406
5
6typedef struct {
7 char *str;
8 char *str2;
9} Class;
10
11typedef 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
25int main(void) {
26 Class obj;
27 Class_Init(&obj, "Hello ", " World");
28}
29