blob: 2a18dbb7050987e7e456a4c6b1e884cc58fc4849 [file] [log] [blame]
Chris Lattner99d724f2008-02-10 23:08:00 +00001// RUN: clang %s -fsyntax-only -verify -pedantic
Chris Lattner529bd022008-01-02 22:50:48 +00002// PR1892
3void f(double a[restrict][5]); // should promote to restrict ptr.
4void f(double (* restrict a)[5]);
5
Steve Naroffba03eda2008-01-29 00:15:50 +00006int foo (__const char *__path);
7int foo(__const char *__restrict __file);
8
Steve Naroff2565eef2008-01-29 18:58:14 +00009void func(const char*); //expected-error{{previous declaration is here}}
10void func(char*); //expected-error{{conflicting types for 'func'}}
11
Chris Lattner1adb8832008-01-14 05:45:46 +000012void g(int (*)(const void **, const void **));
13void g(int (*compar)()) {
14}
15
Eli Friedmanf9633392008-02-15 06:56:02 +000016void h(); //expected-error{{previous declaration is here}}
17void h (const char *fmt, ...) {} //expected-error{{conflicting types for 'h'}}
Chris Lattner868d08f2008-01-31 06:06:29 +000018
19// PR1965
20int t5(b); // expected-error {{parameter list without types}}
Chris Lattner99d724f2008-02-10 23:08:00 +000021int t6(int x, g); // expected-warning {{type specifier required for parameter 'g'}}
Chris Lattner868d08f2008-01-31 06:06:29 +000022
Chris Lattner99d724f2008-02-10 23:08:00 +000023int t7(, ); // expected-error {{expected parameter declarator}} expected-error {{expected parameter declarator}}
24int t8(, int a); // expected-error {{expected parameter declarator}}
25int t9(int a, ); // expected-error {{expected parameter declarator}}
Chris Lattner868d08f2008-01-31 06:06:29 +000026
27
Chris Lattner52804082008-02-17 19:31:09 +000028// PR2042
29void t10(){}
30void t11(){t10(1);}
31