2009-03-24 10:24:46 +08:00
|
|
|
// RUN: clang-cc %s -verify -fsyntax-only
|
2007-12-19 13:31:29 +08:00
|
|
|
typedef char T[4];
|
|
|
|
|
|
|
|
T foo(int n, int m) { } // expected-error {{cannot return array or function}}
|
|
|
|
|
2008-01-17 08:36:28 +08:00
|
|
|
void foof(const char *, ...) __attribute__((__format__(__printf__, 1, 2))), barf (void);
|
|
|
|
|
2008-02-14 10:58:32 +08:00
|
|
|
int typedef validTypeDecl() { } // expected-error {{function definition declared 'typedef'}}
|
|
|
|
|
2008-02-12 12:08:59 +08:00
|
|
|
struct _zend_module_entry { }
|
|
|
|
typedef struct _zend_function_entry { } // expected-error {{cannot combine with previous 'struct' declaration specifier}}
|
2008-02-14 10:58:32 +08:00
|
|
|
static void buggy(int *x) { } // expected-error {{function definition declared 'typedef'}} \
|
|
|
|
// expected-error {{cannot combine with previous 'typedef' declaration specifier}} \
|
|
|
|
// expected-error {{cannot combine with previous 'struct' declaration specifier}}
|
|
|
|
|
2008-04-02 14:50:17 +08:00
|
|
|
// Type qualifiers.
|
|
|
|
typedef int f(void);
|
|
|
|
typedef f* fptr;
|
2009-02-20 07:45:49 +08:00
|
|
|
const f* v1; // expected-warning {{qualifier on function type 'f' (aka 'int (void)') has unspecified behavior}}
|
|
|
|
__restrict__ f* v2; // expected-error {{restrict requires a pointer or reference ('f' (aka 'int (void)') is invalid)}}
|
|
|
|
__restrict__ fptr v3; // expected-error {{pointer to function type 'f' (aka 'int (void)') may not be 'restrict' qualified}}
|
|
|
|
f *__restrict__ v4; // expected-error {{pointer to function type 'f' (aka 'int (void)') may not be 'restrict' qualified}}
|
2008-02-14 10:58:32 +08:00
|
|
|
|