2008-02-11 07:08:00 +08:00
|
|
|
// RUN: clang %s -fsyntax-only -verify -pedantic
|
2008-01-03 06:50:48 +08:00
|
|
|
// PR1892
|
|
|
|
void f(double a[restrict][5]); // should promote to restrict ptr.
|
|
|
|
void f(double (* restrict a)[5]);
|
|
|
|
|
2008-01-29 08:15:50 +08:00
|
|
|
int foo (__const char *__path);
|
|
|
|
int foo(__const char *__restrict __file);
|
|
|
|
|
2008-11-24 07:12:31 +08:00
|
|
|
void func(const char*); // expected-note {{previous declaration is here}}
|
|
|
|
void func(char*); // expected-error{{conflicting types for 'func'}}
|
2008-01-30 02:58:14 +08:00
|
|
|
|
2008-01-14 13:45:46 +08:00
|
|
|
void g(int (*)(const void **, const void **));
|
|
|
|
void g(int (*compar)()) {
|
|
|
|
}
|
|
|
|
|
2008-11-24 07:12:31 +08:00
|
|
|
void h(); // expected-note {{previous declaration is here}}
|
|
|
|
void h (const char *fmt, ...) {} // expected-error{{conflicting types for 'h'}}
|
2008-01-31 14:06:29 +08:00
|
|
|
|
|
|
|
// PR1965
|
|
|
|
int t5(b); // expected-error {{parameter list without types}}
|
2008-04-05 14:32:51 +08:00
|
|
|
int t6(int x, g); // expected-warning {{type specifier missing, defaults to 'int'}}
|
2008-01-31 14:06:29 +08:00
|
|
|
|
2008-02-11 07:08:00 +08:00
|
|
|
int t7(, ); // expected-error {{expected parameter declarator}} expected-error {{expected parameter declarator}}
|
|
|
|
int t8(, int a); // expected-error {{expected parameter declarator}}
|
|
|
|
int t9(int a, ); // expected-error {{expected parameter declarator}}
|
2008-01-31 14:06:29 +08:00
|
|
|
|
|
|
|
|
2008-02-18 03:31:09 +08:00
|
|
|
// PR2042
|
|
|
|
void t10(){}
|
|
|
|
void t11(){t10(1);}
|
|
|
|
|
2008-12-17 15:32:46 +08:00
|
|
|
// PR3208
|
|
|
|
void t12(int) {} // expected-error{{parameter name omitted}}
|
|
|
|
|
2008-12-18 10:01:17 +08:00
|
|
|
// PR2790
|
|
|
|
void t13() {
|
|
|
|
return 0; // expected-warning {{void function 't13' should not return a value}}
|
|
|
|
}
|
|
|
|
int t14() {
|
|
|
|
return; // expected-warning {{non-void function 't14' should return a value}}
|
|
|
|
}
|