xref: /aosp_15_r20/external/clang/test/SemaObjC/no-warn-unimpl-method.m (revision 67e74705e28f6214e480b399dd47ea732279e315)
1*67e74705SXin Li// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -verify %s
2*67e74705SXin Li// expected-no-diagnostics
3*67e74705SXin Li// This program tests that if class implements the forwardInvocation method, then
4*67e74705SXin Li// every method possible is implemented in the class and should not issue
5*67e74705SXin Li// warning of the "Method definition not found" kind. */
6*67e74705SXin Li
7*67e74705SXin Li@interface NSObject
8*67e74705SXin Li@end
9*67e74705SXin Li
10*67e74705SXin Li@interface NSInvocation
11*67e74705SXin Li@end
12*67e74705SXin Li
13*67e74705SXin Li@interface NSProxy
14*67e74705SXin Li@end
15*67e74705SXin Li
16*67e74705SXin Li@protocol MyProtocol
17*67e74705SXin Li        -(void) doSomething;
18*67e74705SXin Li@end
19*67e74705SXin Li
20*67e74705SXin Li@interface DestinationClass : NSObject<MyProtocol>
21*67e74705SXin Li        -(void) doSomething;
22*67e74705SXin Li@end
23*67e74705SXin Li
24*67e74705SXin Li@implementation DestinationClass
25*67e74705SXin Li        -(void) doSomething
26*67e74705SXin Li        {
27*67e74705SXin Li        }
28*67e74705SXin Li@end
29*67e74705SXin Li
30*67e74705SXin Li@interface MyProxy : NSProxy<MyProtocol>
31*67e74705SXin Li{
32*67e74705SXin Li        DestinationClass        *mTarget;
33*67e74705SXin Li}
34*67e74705SXin Li        - (id) init;
35*67e74705SXin Li        - (void)forwardInvocation:(NSInvocation *)anInvocation;
36*67e74705SXin Li@end
37*67e74705SXin Li
38*67e74705SXin Li@implementation MyProxy
39*67e74705SXin Li        - (void)forwardInvocation:(NSInvocation *)anInvocation
40*67e74705SXin Li        {
41*67e74705SXin Li        }
42*67e74705SXin Li	- (id) init { return 0; }
43*67e74705SXin Li@end
44