predefined-function.c revision d7d5f0223bd30dfd618762349c6209dd1d5ea3e6
1// RUN: clang-cc -fsyntax-only -verify -pedantic %s
2
3char *funk(int format);
4enum Test {A=-1};
5char *funk(enum Test x);
6
7int eli(float b); // expected-note {{previous declaration is here}}
8int b(int c) {return 1;}
9
10int foo();
11int foo()
12{
13    int eli(int (int)); // expected-error {{conflicting types for 'eli'}}
14    eli(b); // expected-error{{incompatible type passing}}
15	return 0;
16}
17
18int bar();
19int bar(int i) // expected-note {{previous definition is here}}
20{
21	return 0;
22}
23int bar() // expected-error {{redefinition of 'bar'}}
24{
25	return 0;
26}
27
28int foobar(int); // note {{previous declaration is here}}
29int foobar() // error {{conflicting types for 'foobar'}}
30{
31	return 0;
32}
33
34int wibble(); // expected-note {{previous declaration is here}}
35float wibble() // expected-error {{conflicting types for 'wibble'}}
36{
37	return 0.0f;
38}
39