2011-03-24 03:50:54 +08:00
|
|
|
// RUN: %clang_cc1 %s -fsyntax-only -verify
|
2012-10-19 20:44:48 +08:00
|
|
|
// expected-no-diagnostics
|
2011-03-24 03:50:54 +08:00
|
|
|
// rdar:// 9129552
|
|
|
|
// PR9406
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
char *str;
|
|
|
|
char *str2;
|
|
|
|
} Class;
|
|
|
|
|
|
|
|
typedef union {
|
|
|
|
Class *object;
|
|
|
|
} Instance __attribute__((transparent_union));
|
|
|
|
|
|
|
|
__attribute__((overloadable)) void Class_Init(Instance this, char *str, void *str2) {
|
|
|
|
this.object->str = str;
|
|
|
|
this.object->str2 = str2;
|
|
|
|
}
|
|
|
|
|
|
|
|
__attribute__((overloadable)) void Class_Init(Instance this, char *str) {
|
|
|
|
this.object->str = str;
|
|
|
|
this.object->str2 = str;
|
|
|
|
}
|
|
|
|
|
|
|
|
int main(void) {
|
|
|
|
Class obj;
|
|
|
|
Class_Init(&obj, "Hello ", " World");
|
|
|
|
}
|
|
|
|
|