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}} \
|
2013-03-19 06:52:47 +08:00
|
|
|
// expected-warning {{typedef requires a name}}
|
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;
|
2013-11-13 14:57:53 +08:00
|
|
|
|
|
|
|
// PR8264
|
|
|
|
const const int pr8264_1 = 0; // expected-warning {{duplicate 'const' declaration specifier}}
|
|
|
|
volatile volatile int pr8264_2; // expected-warning {{duplicate 'volatile' declaration specifier}}
|
|
|
|
char * restrict restrict pr8264_3; // expected-warning {{duplicate 'restrict' declaration specifier}}
|
|
|
|
|
|
|
|
extern extern int pr8264_4; // expected-warning {{duplicate 'extern' declaration specifier}}
|
|
|
|
void pr8264_5() {
|
|
|
|
register register int x; // expected-warning {{duplicate 'register' declaration specifier}}
|
|
|
|
}
|
|
|
|
|
|
|
|
inline inline void pr8264_6() {} // expected-warning {{duplicate 'inline' declaration specifier}}
|
|
|
|
_Noreturn _Noreturn void pr8264_7(); // expected-warning {{duplicate '_Noreturn' declaration specifier}}
|