Add include needed for MSVC.
[clang/acc.git] / test / Sema / declspec.c
blobe325cc83521ab410065c402fa830103aeee36712
1 // RUN: clang-cc %s -verify -fsyntax-only
2 typedef char T[4];
4 T foo(int n, int m) { } // expected-error {{cannot return array or function}}
6 void foof(const char *, ...) __attribute__((__format__(__printf__, 1, 2))), barf (void);
8 int typedef validTypeDecl() { } // expected-error {{function definition declared 'typedef'}}
10 struct _zend_module_entry { }
11 typedef struct _zend_function_entry { } // expected-error {{cannot combine with previous 'struct' declaration specifier}}
12 static void buggy(int *x) { } // expected-error {{function definition declared 'typedef'}} \
13 // expected-error {{cannot combine with previous 'typedef' declaration specifier}} \
14 // expected-error {{cannot combine with previous 'struct' declaration specifier}}
16 // Type qualifiers.
17 typedef int f(void);
18 typedef f* fptr;
19 const f* v1; // expected-warning {{qualifier on function type 'f' (aka 'int (void)') has unspecified behavior}}
20 __restrict__ f* v2; // expected-error {{restrict requires a pointer or reference ('f' (aka 'int (void)') is invalid)}}
21 __restrict__ fptr v3; // expected-error {{pointer to function type 'f' (aka 'int (void)') may not be 'restrict' qualified}}
22 f *__restrict__ v4; // expected-error {{pointer to function type 'f' (aka 'int (void)') may not be 'restrict' qualified}}