predefined-function.c 927 B

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