minix/external/bsd/llvm/dist/clang/test/SemaObjC/method-typecheck-3.m
Lionel Sambuc f4a2713ac8 Importing netbsd clang -- pristine
Change-Id: Ia40e9ffdf29b5dab2f122f673ff6802a58bc690f
2014-07-28 17:05:57 +02:00

22 lines
733 B
Objective-C

// RUN: %clang_cc1 -Wmethod-signatures -fsyntax-only -verify %s
@class B;
@interface A
- (B*)obj;
- (B*)a; // expected-note {{previous definition is here}}
- (void)takesA: (A*)a; // expected-note {{previous definition is here}}
- (void)takesId: (id)a; // expected-note {{previous definition is here}}
@end
@interface B : A
@end
@implementation B
- (id)obj {return self;} // 'id' overrides are white-listed?
- (A*)a { return self;} // expected-warning {{conflicting return type in implementation of 'a'}}
- (void)takesA: (B*)a // expected-warning {{conflicting parameter types in implementation of 'takesA:'}}
{}
- (void)takesId: (B*)a // expected-warning {{conflicting parameter types in implementation of 'takesId:'}}
{}
@end