Chris Lattner | 5519644 | 2007-11-20 19:04:50 +0000 | [diff] [blame] | 1 | // RUN: clang -fsyntax-only -verify -pedantic %s |
Steve Naroff | 4a74678 | 2008-01-09 22:43:08 +0000 | [diff] [blame] | 2 | |
| 3 | char *funk(int format); |
| 4 | enum Test {A=-1}; |
| 5 | char *funk(enum Test x); |
| 6 | |
Steve Naroff | 837618c | 2008-01-16 15:01:34 +0000 | [diff] [blame] | 7 | int eli(float b); // expected-error {{previous declaration is here}} |
Steve Naroff | ffce4d5 | 2008-01-09 23:34:55 +0000 | [diff] [blame] | 8 | int b(int c) {return 1;} |
| 9 | |
Chris Lattner | 5519644 | 2007-11-20 19:04:50 +0000 | [diff] [blame] | 10 | int foo(); |
| 11 | int foo() |
| 12 | { |
Steve Naroff | 837618c | 2008-01-16 15:01:34 +0000 | [diff] [blame] | 13 | int eli(int (int)); // expected-error {{conflicting types for 'eli'}} |
Steve Naroff | ffce4d5 | 2008-01-09 23:34:55 +0000 | [diff] [blame] | 14 | eli(b); |
Chris Lattner | 5519644 | 2007-11-20 19:04:50 +0000 | [diff] [blame] | 15 | return 0; |
| 16 | } |
| 17 | |
| 18 | int bar(); |
| 19 | int bar(int i) // expected-error {{previous definition is here}} |
| 20 | { |
| 21 | return 0; |
| 22 | } |
Chris Lattner | 5280408 | 2008-02-17 19:31:09 +0000 | [diff] [blame] | 23 | int bar() // expected-error {{redefinition of 'bar'}} |
Chris Lattner | 5519644 | 2007-11-20 19:04:50 +0000 | [diff] [blame] | 24 | { |
| 25 | return 0; |
| 26 | } |
| 27 | |
Chris Lattner | 5280408 | 2008-02-17 19:31:09 +0000 | [diff] [blame] | 28 | #if 0 |
Chris Lattner | c41c123 | 2008-11-21 01:05:35 +0000 | [diff] [blame^] | 29 | int foobar(int); // error {{previous declaration is here}} |
| 30 | int foobar() // error {{conflicting types for 'foobar'}} |
Chris Lattner | 5519644 | 2007-11-20 19:04:50 +0000 | [diff] [blame] | 31 | { |
| 32 | return 0; |
| 33 | } |
Chris Lattner | 5280408 | 2008-02-17 19:31:09 +0000 | [diff] [blame] | 34 | #endif |
Chris Lattner | 5519644 | 2007-11-20 19:04:50 +0000 | [diff] [blame] | 35 | |
Steve Naroff | 837618c | 2008-01-16 15:01:34 +0000 | [diff] [blame] | 36 | int wibble(); // expected-error {{previous declaration is here}} |
| 37 | float wibble() // expected-error {{conflicting types for 'wibble'}} |
Chris Lattner | 5519644 | 2007-11-20 19:04:50 +0000 | [diff] [blame] | 38 | { |
| 39 | return 0.0f; |
| 40 | } |