diff options
Diffstat (limited to 'clang/test/Sema/transparent-union.c')
| -rw-r--r-- | clang/test/Sema/transparent-union.c | 18 | 
1 files changed, 18 insertions, 0 deletions
| diff --git a/clang/test/Sema/transparent-union.c b/clang/test/Sema/transparent-union.c index 27d5c2403b4..d13b4045a91 100644 --- a/clang/test/Sema/transparent-union.c +++ b/clang/test/Sema/transparent-union.c @@ -17,6 +17,24 @@ void g(int *ip, float *fp, char *cp) {    tu.ip = ip;  } +/* Test ability to redeclare a function taking a transparent_union arg +   with various compatible and incompatible argument types. */ + +void fip(TU); +void fip(int *i) {} + +void ffp(TU); +void ffp(float *f) {} + +void fvp(TU); // expected-note{{previous declaration is here}} +void fvp(void *p) {} // expected-error{{conflicting types}} + +void fsp(TU); // expected-note{{previous declaration is here}} +void fsp(short *s) {} // expected-error{{conflicting types}} + +void fi(TU); // expected-note{{previous declaration is here}} +void fi(int i) {} // expected-error{{conflicting types}} +  /* FIXME: we'd like to just use an "int" here and align it differently     from the normal "int", but if we do so we lose the alignment     information from the typedef within the compiler. */ | 

