YouCompleteMe/cpp/llvm/tools/clang/test/Sema/overloaded-func-transparent-union.c
Strahinja Val Markovic 1f51a89d39 Adding more llvm/clang files
These were ignored by git accidentally. We want ALL OF THEM since they all came
in the llvm/clang source distribution.
2012-07-05 17:55:45 -07:00

29 lines
548 B
C

// RUN: %clang_cc1 %s -fsyntax-only -verify
// 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");
}