declspec.c revision 4ed5d91db256f7dbe6bf716da0b801004c197254
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}}
11typedef struct _zend_function_entry { } // expected-error {{expected ';' after struct}} \
12                                        // expected-error {{declaration does not declare anything}}
13static void buggy(int *x) { }
14
15// Type qualifiers.
16typedef int f(void);
17typedef f* fptr;
18const f* v1;         // expected-warning {{qualifier on function type 'f' (aka 'int (void)') has unspecified behavior}}
19__restrict__ f* v2;  // expected-error {{restrict requires a pointer or reference ('f' (aka 'int (void)') is invalid)}}
20__restrict__ fptr v3; // expected-error {{pointer to function type 'f' (aka 'int (void)') may not be 'restrict' qualified}}
21f *__restrict__ v4;   // expected-error {{pointer to function type 'f' (aka 'int (void)') may not be 'restrict' qualified}}
22
23restrict struct hallo; // expected-error {{restrict requires a pointer or reference}}
24
25// PR6180
26struct test1 {
27} // expected-error {{expected ';' after struct}}
28
29void test2() {}
30
31