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