2008-02-11 07:08:00 +08:00
|
|
|
// RUN: clang %s -fsyntax-only -verify -pedantic
|
2006-08-07 02:22:00 +08:00
|
|
|
|
2007-06-09 02:15:09 +08:00
|
|
|
extern int a1[];
|
2006-08-07 02:22:00 +08:00
|
|
|
|
|
|
|
void f0();
|
|
|
|
void f1(int [*]);
|
|
|
|
void f2(int [const *]);
|
|
|
|
void f3(int [volatile const*]);
|
2008-04-05 14:32:51 +08:00
|
|
|
int f4(*XX)(void); /* expected-error {{cannot return}} expected-warning {{type specifier missing, defaults to 'int'}} */
|
2006-08-07 02:22:00 +08:00
|
|
|
|
|
|
|
char ((((*X))));
|
|
|
|
|
|
|
|
void (*signal(int, void (*)(int)))(int);
|
|
|
|
|
|
|
|
int a, ***C, * const D, b(int);
|
|
|
|
|
|
|
|
int *A;
|
|
|
|
|
2006-08-14 03:59:13 +08:00
|
|
|
struct str;
|
|
|
|
|
2006-08-13 02:40:31 +08:00
|
|
|
int test2(int *P, int A) {
|
2006-08-14 03:59:13 +08:00
|
|
|
struct str;
|
|
|
|
|
|
|
|
// Hard case for array decl, not Array[*].
|
2006-08-13 02:40:31 +08:00
|
|
|
int Array[*(int*)P+A];
|
|
|
|
}
|
2006-08-14 03:59:13 +08:00
|
|
|
|
2008-04-06 14:47:48 +08:00
|
|
|
typedef int atype;
|
|
|
|
int test3(x,
|
|
|
|
atype /* expected-error {{unexpected type name 'atype': expected identifier}} */
|
|
|
|
) int x, atype; {}
|
2006-08-14 03:59:13 +08:00
|
|
|
|
2008-04-06 14:50:56 +08:00
|
|
|
int test4(x, x) int x; {} /* expected-error {{redefinition of parameter 'x'}} */
|
|
|
|
|