46 lines · c
1/* RUN: %clang_cc1 -fsyntax-only -verify -std=c90 -pedantic %s2 */3void4foo (void)5{6 struct b;7 struct b* x = 0;8 struct b* y = &*x;9}10 11void foo2 (void)12{13 typedef int (*arrayptr)[];14 arrayptr x = 0;15 arrayptr y = &*x;16}17 18void foo3 (void)19{20 void* x = 0;21 void* y = &*x; /* expected-warning{{address of an expression of type 'void'}}22 expected-warning {{ISO C does not allow indirection on operand of type 'void *'}} */23}24 25extern const void cv1;26 27const void *foo4 (void)28{29 return &cv1;30}31 32extern void cv2;33void *foo5 (void)34{35 return &cv2; /* expected-warning{{address of an expression of type 'void'}} */36}37 38typedef const void CVT;39extern CVT cv3;40 41const void *foo6 (void)42{43 return &cv3;44}45 46