Daniel Dunbar | d7d5f02 | 2009-03-24 02:24:46 +0000 | [diff] [blame] | 1 | // RUN: clang-cc -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 | |||||
Chris Lattner | 5f4a682 | 2008-11-23 23:12:31 +0000 | [diff] [blame] | 7 | int eli(float b); // expected-note {{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(); |
Mike Stump | 1eb4433 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 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; | ||||
Chris Lattner | 5519644 | 2007-11-20 19:04:50 +0000 | [diff] [blame] | 15 | } |
16 | |||||
17 | int bar(); | ||||
Chris Lattner | 5f4a682 | 2008-11-23 23:12:31 +0000 | [diff] [blame] | 18 | int bar(int i) // expected-note {{previous definition is here}} |
Chris Lattner | 5519644 | 2007-11-20 19:04:50 +0000 | [diff] [blame] | 19 | { |
Mike Stump | 1eb4433 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 20 | return 0; |
Chris Lattner | 5519644 | 2007-11-20 19:04:50 +0000 | [diff] [blame] | 21 | } |
Chris Lattner | 5280408 | 2008-02-17 19:31:09 +0000 | [diff] [blame] | 22 | int bar() // expected-error {{redefinition of 'bar'}} |
Chris Lattner | 5519644 | 2007-11-20 19:04:50 +0000 | [diff] [blame] | 23 | { |
Mike Stump | 1eb4433 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 24 | return 0; |
Chris Lattner | 5519644 | 2007-11-20 19:04:50 +0000 | [diff] [blame] | 25 | } |
26 | |||||
Chris Lattner | 5f4a682 | 2008-11-23 23:12:31 +0000 | [diff] [blame] | 27 | int foobar(int); // note {{previous declaration is here}} |
Chris Lattner | c41c123 | 2008-11-21 01:05:35 +0000 | [diff] [blame] | 28 | int foobar() // error {{conflicting types for 'foobar'}} |
Chris Lattner | 5519644 | 2007-11-20 19:04:50 +0000 | [diff] [blame] | 29 | { |
Mike Stump | 1eb4433 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 30 | return 0; |
Chris Lattner | 5519644 | 2007-11-20 19:04:50 +0000 | [diff] [blame] | 31 | } |
32 | |||||
Chris Lattner | 5f4a682 | 2008-11-23 23:12:31 +0000 | [diff] [blame] | 33 | int wibble(); // expected-note {{previous declaration is here}} |
Steve Naroff | 837618c | 2008-01-16 15:01:34 +0000 | [diff] [blame] | 34 | float wibble() // expected-error {{conflicting types for 'wibble'}} |
Chris Lattner | 5519644 | 2007-11-20 19:04:50 +0000 | [diff] [blame] | 35 | { |
Mike Stump | 1eb4433 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 36 | return 0.0f; |
Chris Lattner | 5519644 | 2007-11-20 19:04:50 +0000 | [diff] [blame] | 37 | } |