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