You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
575 B
30 lines
575 B
4 months ago
|
// RUN: %clang_cc1 %s -fsyntax-only -verify
|
||
|
// expected-no-diagnostics
|
||
|
// 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");
|
||
|
}
|
||
|
|