minix/external/bsd/llvm/dist/clang/test/Sema/overloaded-func-transparent-union.c
Lionel Sambuc f4a2713ac8 Importing netbsd clang -- pristine
Change-Id: Ia40e9ffdf29b5dab2f122f673ff6802a58bc690f
2014-07-28 17:05:57 +02:00

29 lines
575 B
C

// 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");
}