1*f4a2713aSLionel Sambuc // RUN: %clang_cc1 %s -fsyntax-only -verify 2*f4a2713aSLionel Sambuc // expected-no-diagnostics 3*f4a2713aSLionel Sambuc // rdar:// 9129552 4*f4a2713aSLionel Sambuc // PR9406 5*f4a2713aSLionel Sambuc 6*f4a2713aSLionel Sambuc typedef struct { 7*f4a2713aSLionel Sambuc char *str; 8*f4a2713aSLionel Sambuc char *str2; 9*f4a2713aSLionel Sambuc } Class; 10*f4a2713aSLionel Sambuc 11*f4a2713aSLionel Sambuc typedef union { 12*f4a2713aSLionel Sambuc Class *object; 13*f4a2713aSLionel Sambuc } Instance __attribute__((transparent_union)); 14*f4a2713aSLionel Sambuc Class_Init(Instance this,char * str,void * str2)15*f4a2713aSLionel Sambuc__attribute__((overloadable)) void Class_Init(Instance this, char *str, void *str2) { 16*f4a2713aSLionel Sambuc this.object->str = str; 17*f4a2713aSLionel Sambuc this.object->str2 = str2; 18*f4a2713aSLionel Sambuc } 19*f4a2713aSLionel Sambuc Class_Init(Instance this,char * str)20*f4a2713aSLionel Sambuc__attribute__((overloadable)) void Class_Init(Instance this, char *str) { 21*f4a2713aSLionel Sambuc this.object->str = str; 22*f4a2713aSLionel Sambuc this.object->str2 = str; 23*f4a2713aSLionel Sambuc } 24*f4a2713aSLionel Sambuc main(void)25*f4a2713aSLionel Sambucint main(void) { 26*f4a2713aSLionel Sambuc Class obj; 27*f4a2713aSLionel Sambuc Class_Init(&obj, "Hello ", " World"); 28*f4a2713aSLionel Sambuc } 29*f4a2713aSLionel Sambuc 30