2009-12-16 04:14:24 +08:00
|
|
|
// RUN: %clang_cc1 %s -verify -fsyntax-only
|
2007-12-19 13:31:29 +08:00
|
|
|
typedef char T[4];
|
|
|
|
|
2010-01-12 02:46:21 +08:00
|
|
|
T foo(int n, int m) { } // expected-error {{cannot return array type}}
|
2007-12-19 13:31:29 +08:00
|
|
|
|
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'}}
|
|
|
|
|
2010-02-02 09:23:29 +08:00
|
|
|
struct _zend_module_entry { } // expected-error {{expected ';' after struct}}
|
2010-02-03 01:32:27 +08:00
|
|
|
int gv1;
|
2010-02-02 09:23:29 +08:00
|
|
|
typedef struct _zend_function_entry { } // expected-error {{expected ';' after struct}} \
|
2010-04-09 05:33:23 +08:00
|
|
|
// expected-warning {{declaration does not declare anything}}
|
2010-02-03 01:32:27 +08:00
|
|
|
int gv2;
|
|
|
|
|
2010-02-02 09:23:29 +08:00
|
|
|
static void buggy(int *x) { }
|
2008-02-14 10:58:32 +08:00
|
|
|
|
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
|
|
|
|
2009-12-17 19:35:26 +08:00
|
|
|
restrict struct hallo; // expected-error {{restrict requires a pointer or reference}}
|
2010-02-02 09:23:29 +08:00
|
|
|
|
|
|
|
// PR6180
|
|
|
|
struct test1 {
|
|
|
|
} // expected-error {{expected ';' after struct}}
|
|
|
|
|
|
|
|
void test2() {}
|
|
|
|
|
2010-03-01 02:18:36 +08:00
|
|
|
|
|
|
|
// PR6423
|
|
|
|
struct test3s {
|
|
|
|
} // expected-error {{expected ';' after struct}}
|
|
|
|
typedef int test3g;
|