1*67e74705SXin Li // RUN: %clang_cc1 %s -verify -fsyntax-only 2*67e74705SXin Li typedef char T[4]; 3*67e74705SXin Li foo(int n,int m)4*67e74705SXin LiT foo(int n, int m) { } // expected-error {{cannot return array type}} 5*67e74705SXin Li 6*67e74705SXin Li void foof(const char *, ...) __attribute__((__format__(__printf__, 1, 2))), barf (void); 7*67e74705SXin Li 8*67e74705SXin Li int typedef validTypeDecl() { } // expected-error {{function definition declared 'typedef'}} 9*67e74705SXin Li 10*67e74705SXin Li struct _zend_module_entry { } // expected-error {{expected ';' after struct}} 11*67e74705SXin Li int gv1; 12*67e74705SXin Li typedef struct _zend_function_entry { } // expected-error {{expected ';' after struct}} \ 13*67e74705SXin Li // expected-warning {{typedef requires a name}} 14*67e74705SXin Li int gv2; 15*67e74705SXin Li buggy(int * x)16*67e74705SXin Listatic void buggy(int *x) { } 17*67e74705SXin Li 18*67e74705SXin Li // Type qualifiers. 19*67e74705SXin Li typedef int f(void); 20*67e74705SXin Li typedef f* fptr; 21*67e74705SXin Li const f* v1; // expected-warning {{qualifier on function type 'f' (aka 'int (void)') has unspecified behavior}} 22*67e74705SXin Li __restrict__ f* v2; // expected-error {{restrict requires a pointer or reference ('f' (aka 'int (void)') is invalid)}} 23*67e74705SXin Li __restrict__ fptr v3; // expected-error {{pointer to function type 'f' (aka 'int (void)') may not be 'restrict' qualified}} 24*67e74705SXin Li f *__restrict__ v4; // expected-error {{pointer to function type 'f' (aka 'int (void)') may not be 'restrict' qualified}} 25*67e74705SXin Li 26*67e74705SXin Li restrict struct hallo; // expected-error {{restrict requires a pointer or reference}} 27*67e74705SXin Li 28*67e74705SXin Li // PR6180 29*67e74705SXin Li struct test1 { 30*67e74705SXin Li } // expected-error {{expected ';' after struct}} 31*67e74705SXin Li test2()32*67e74705SXin Livoid test2() {} 33*67e74705SXin Li 34*67e74705SXin Li 35*67e74705SXin Li // PR6423 36*67e74705SXin Li struct test3s { 37*67e74705SXin Li } // expected-error {{expected ';' after struct}} 38*67e74705SXin Li typedef int test3g; 39*67e74705SXin Li 40*67e74705SXin Li // PR8264 41*67e74705SXin Li const const int pr8264_1 = 0; // expected-warning {{duplicate 'const' declaration specifier}} 42*67e74705SXin Li volatile volatile int pr8264_2; // expected-warning {{duplicate 'volatile' declaration specifier}} 43*67e74705SXin Li char * restrict restrict pr8264_3; // expected-warning {{duplicate 'restrict' declaration specifier}} 44*67e74705SXin Li 45*67e74705SXin Li extern extern int pr8264_4; // expected-warning {{duplicate 'extern' declaration specifier}} pr8264_5()46*67e74705SXin Livoid pr8264_5() { 47*67e74705SXin Li register register int x; // expected-warning {{duplicate 'register' declaration specifier}} 48*67e74705SXin Li } 49*67e74705SXin Li pr8264_6()50*67e74705SXin Liinline inline void pr8264_6() {} // expected-warning {{duplicate 'inline' declaration specifier}} 51*67e74705SXin Li _Noreturn _Noreturn void pr8264_7(); // expected-warning {{duplicate '_Noreturn' declaration specifier}} 52