2012-01-18 06:24:32 +08:00
|
|
|
// RUN: %clang_cc1 -Wduplicate-method-match -fsyntax-only -verify %s
|
2007-10-06 02:00:57 +08:00
|
|
|
|
|
|
|
@interface SUPER
|
|
|
|
- (int) meth;
|
|
|
|
+ (int) foobar;
|
|
|
|
@end
|
|
|
|
|
|
|
|
@interface T @end
|
|
|
|
|
|
|
|
@interface class1 : SUPER
|
2008-11-24 07:12:31 +08:00
|
|
|
- (int) meth; // expected-note {{previous declaration is here}}
|
2007-10-06 02:00:57 +08:00
|
|
|
- (int*) meth; // expected-error {{duplicate declaration of method 'meth'}}
|
2011-12-14 03:40:34 +08:00
|
|
|
- (T*) meth1; // expected-note {{previous declaration is here}}
|
|
|
|
- (T*) meth1; // expected-warning {{multiple declarations of method 'meth1' found and ignored}}
|
2007-10-06 02:00:57 +08:00
|
|
|
+ (T*) meth1;
|
|
|
|
@end
|
|
|
|
|
|
|
|
@interface class1(cat)
|
2008-11-24 07:12:31 +08:00
|
|
|
- (int) catm : (char)ch1; // expected-note {{previous declaration is here}}
|
2007-10-06 02:00:57 +08:00
|
|
|
- (int) catm1 : (char)ch : (int)i;
|
|
|
|
- (int) catm : (char*)ch1; // expected-error {{duplicate declaration of method 'catm:'}}
|
|
|
|
+ (int) catm1 : (char)ch : (int)i;
|
|
|
|
+ (T*) meth1;
|
|
|
|
@end
|
|
|
|
|
|
|
|
@interface class1(cat1)
|
2008-11-24 07:12:31 +08:00
|
|
|
+ (int) catm1 : (char)ch : (int)i; // expected-note {{previous declaration is here}}
|
|
|
|
+ (T*) meth1; // expected-note {{previous declaration is here}}
|
2007-10-06 02:00:57 +08:00
|
|
|
+ (int) catm1 : (char)ch : (int*)i; // expected-error {{duplicate declaration of method 'catm1::'}}
|
|
|
|
+ (T**) meth1; // expected-error {{duplicate declaration of method 'meth1'}}
|
|
|
|
+ (int) foobar;
|
|
|
|
@end
|
2007-10-13 02:49:25 +08:00
|
|
|
|
|
|
|
@protocol P
|
2008-11-24 07:12:31 +08:00
|
|
|
- (int) meth; // expected-note {{previous declaration is here}}
|
2007-10-13 07:43:31 +08:00
|
|
|
- (int*) meth; // expected-error {{duplicate declaration of method 'meth'}}
|
2007-10-13 02:49:25 +08:00
|
|
|
@end
|
|
|
|
|