Daniel Dunbar | a572887 | 2009-12-15 20:14:24 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify %s |
Fariborz Jahanian | 85ff264 | 2007-10-05 18:00:57 +0000 | [diff] [blame] | 2 | |
| 3 | @interface SUPER |
| 4 | - (int) meth; |
| 5 | + (int) foobar; |
| 6 | @end |
| 7 | |
| 8 | @interface T @end |
| 9 | |
| 10 | @interface class1 : SUPER |
Chris Lattner | 5f4a682 | 2008-11-23 23:12:31 +0000 | [diff] [blame] | 11 | - (int) meth; // expected-note {{previous declaration is here}} |
Fariborz Jahanian | 85ff264 | 2007-10-05 18:00:57 +0000 | [diff] [blame] | 12 | - (int*) meth; // expected-error {{duplicate declaration of method 'meth'}} |
Fariborz Jahanian | 7209646 | 2011-12-13 19:40:34 +0000 | [diff] [blame] | 13 | - (T*) meth1; // expected-note {{previous declaration is here}} |
| 14 | - (T*) meth1; // expected-warning {{multiple declarations of method 'meth1' found and ignored}} |
Fariborz Jahanian | 85ff264 | 2007-10-05 18:00:57 +0000 | [diff] [blame] | 15 | + (T*) meth1; |
| 16 | @end |
| 17 | |
| 18 | @interface class1(cat) |
Chris Lattner | 5f4a682 | 2008-11-23 23:12:31 +0000 | [diff] [blame] | 19 | - (int) catm : (char)ch1; // expected-note {{previous declaration is here}} |
Fariborz Jahanian | 85ff264 | 2007-10-05 18:00:57 +0000 | [diff] [blame] | 20 | - (int) catm1 : (char)ch : (int)i; |
| 21 | - (int) catm : (char*)ch1; // expected-error {{duplicate declaration of method 'catm:'}} |
| 22 | + (int) catm1 : (char)ch : (int)i; |
| 23 | + (T*) meth1; |
| 24 | @end |
| 25 | |
| 26 | @interface class1(cat1) |
Chris Lattner | 5f4a682 | 2008-11-23 23:12:31 +0000 | [diff] [blame] | 27 | + (int) catm1 : (char)ch : (int)i; // expected-note {{previous declaration is here}} |
| 28 | + (T*) meth1; // expected-note {{previous declaration is here}} |
Fariborz Jahanian | 85ff264 | 2007-10-05 18:00:57 +0000 | [diff] [blame] | 29 | + (int) catm1 : (char)ch : (int*)i; // expected-error {{duplicate declaration of method 'catm1::'}} |
| 30 | + (T**) meth1; // expected-error {{duplicate declaration of method 'meth1'}} |
| 31 | + (int) foobar; |
| 32 | @end |
Steve Naroff | 8f74476 | 2007-10-12 18:49:25 +0000 | [diff] [blame] | 33 | |
| 34 | @protocol P |
Chris Lattner | 5f4a682 | 2008-11-23 23:12:31 +0000 | [diff] [blame] | 35 | - (int) meth; // expected-note {{previous declaration is here}} |
Fariborz Jahanian | 1109b42 | 2007-10-12 23:43:31 +0000 | [diff] [blame] | 36 | - (int*) meth; // expected-error {{duplicate declaration of method 'meth'}} |
Steve Naroff | 8f74476 | 2007-10-12 18:49:25 +0000 | [diff] [blame] | 37 | @end |
| 38 | |