xref: /aosp_15_r20/external/clang/test/SemaObjC/dist-object-modifiers.m (revision 67e74705e28f6214e480b399dd47ea732279e315)
1*67e74705SXin Li// RUN: %clang_cc1  -fsyntax-only -verify -Wno-objc-root-class %s
2*67e74705SXin Li// rdar://7076235
3*67e74705SXin Li
4*67e74705SXin Li@protocol P
5*67e74705SXin Li- (bycopy id)serverPID; // expected-note {{previous declaration is here}}
6*67e74705SXin Li- (void)doStuff:(bycopy id)clientId; // expected-note {{previous declaration is here}}
7*67e74705SXin Li- (bycopy id)Ok;
8*67e74705SXin Li+ (oneway id) stillMore : (byref id)Arg : (bycopy oneway id)Arg1;  // expected-note 3 {{previous declaration is here}}
9*67e74705SXin Li@end
10*67e74705SXin Li
11*67e74705SXin Li@interface I <P>
12*67e74705SXin Li- (id)Ok;
13*67e74705SXin Li@end
14*67e74705SXin Li
15*67e74705SXin Li@implementation I
16*67e74705SXin Li- (id)serverPID { return 0; } // expected-warning {{conflicting distributed object modifiers on return type in implementation of 'serverPID'}}
17*67e74705SXin Li- (void)doStuff:(id)clientId { } // expected-warning {{conflicting distributed object modifiers on parameter type in implementation of 'doStuff:'}}
18*67e74705SXin Li- (bycopy id)Ok { return 0; }
19*67e74705SXin Li+ (id) stillMore : (id)Arg  : (bycopy id)Arg1 { return Arg; } // expected-warning {{conflicting distributed object modifiers on return type in implementation of 'stillMore::'}} \
20*67e74705SXin Li                                                              // expected-warning 2{{conflicting distributed object modifiers on parameter type in implementation of 'stillMore::'}}
21*67e74705SXin Li@end
22