2009-12-15 23:14:24 +03:00
|
|
|
// RUN: %clang_cc1 -fsyntax-only -verify -pedantic %s
|
2008-01-10 01:43:08 +03:00
|
|
|
|
|
|
|
char *funk(int format);
|
|
|
|
enum Test {A=-1};
|
|
|
|
char *funk(enum Test x);
|
|
|
|
|
2008-11-24 02:12:31 +03:00
|
|
|
int eli(float b); // expected-note {{previous declaration is here}}
|
2008-01-10 02:34:55 +03:00
|
|
|
int b(int c) {return 1;}
|
|
|
|
|
2007-11-20 22:04:50 +03:00
|
|
|
int foo();
|
2009-09-09 19:08:12 +04:00
|
|
|
int foo() {
|
|
|
|
int eli(int (int)); // expected-error {{conflicting types for 'eli'}}
|
|
|
|
eli(b); // expected-error{{incompatible type passing}}
|
|
|
|
return 0;
|
2007-11-20 22:04:50 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
int bar();
|
2008-11-24 02:12:31 +03:00
|
|
|
int bar(int i) // expected-note {{previous definition is here}}
|
2007-11-20 22:04:50 +03:00
|
|
|
{
|
2009-09-09 19:08:12 +04:00
|
|
|
return 0;
|
2007-11-20 22:04:50 +03:00
|
|
|
}
|
2008-02-17 22:31:09 +03:00
|
|
|
int bar() // expected-error {{redefinition of 'bar'}}
|
2007-11-20 22:04:50 +03:00
|
|
|
{
|
2009-09-09 19:08:12 +04:00
|
|
|
return 0;
|
2007-11-20 22:04:50 +03:00
|
|
|
}
|
|
|
|
|
2008-11-24 02:12:31 +03:00
|
|
|
int foobar(int); // note {{previous declaration is here}}
|
2008-11-21 04:05:35 +03:00
|
|
|
int foobar() // error {{conflicting types for 'foobar'}}
|
2007-11-20 22:04:50 +03:00
|
|
|
{
|
2009-09-09 19:08:12 +04:00
|
|
|
return 0;
|
2007-11-20 22:04:50 +03:00
|
|
|
}
|
|
|
|
|
2008-11-24 02:12:31 +03:00
|
|
|
int wibble(); // expected-note {{previous declaration is here}}
|
2008-01-16 18:01:34 +03:00
|
|
|
float wibble() // expected-error {{conflicting types for 'wibble'}}
|
2007-11-20 22:04:50 +03:00
|
|
|
{
|
2009-09-09 19:08:12 +04:00
|
|
|
return 0.0f;
|
2007-11-20 22:04:50 +03:00
|
|
|
}
|