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