predefined-function.c revision c41c1235e0d570e153150f994d28c4d2042c22ec
1// RUN: clang -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-error {{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); 15 return 0; 16} 17 18int bar(); 19int bar(int i) // expected-error {{previous definition is here}} 20{ 21 return 0; 22} 23int bar() // expected-error {{redefinition of 'bar'}} 24{ 25 return 0; 26} 27 28#if 0 29int foobar(int); // error {{previous declaration is here}} 30int foobar() // error {{conflicting types for 'foobar'}} 31{ 32 return 0; 33} 34#endif 35 36int wibble(); // expected-error {{previous declaration is here}} 37float wibble() // expected-error {{conflicting types for 'wibble'}} 38{ 39 return 0.0f; 40} 41