xref: /llvm-project/clang/test/Rewriter/property-dot-syntax.mm (revision 0f1c1be1968076d6f96f8a7bcc4a15cf195ecd97)
1// RUN: %clang_cc1 -x objective-c++ -Wno-return-type -fblocks -fms-extensions -rewrite-objc -fobjc-runtime=macosx-fragile-10.5 %s -o %t-rw.cpp
2// RUN: %clang_cc1 -fsyntax-only -std=gnu++98 -fblocks -Wno-address-of-temporary -D"id=void*" -D"SEL=void*" -D"__declspec(X)=" %t-rw.cpp
3
4void *sel_registerName(const char *);
5
6@class NSString;
7
8@protocol CoreDAVAccountInfoProvider
9- (NSString *)userAgentHeader;
10@end
11
12@interface CoreDAVTask
13{
14  id<CoreDAVAccountInfoProvider> _accountInfoProvider;
15}
16- (void)METHOD;
17@end
18
19@implementation CoreDAVTask
20- (void)METHOD {
21  if ([_accountInfoProvider userAgentHeader]) {
22  }
23  if (_accountInfoProvider.userAgentHeader) {
24  }
25}
26@end
27
28@interface A { }
29@property (retain) NSString *scheme;
30@end
31
32@interface B : A {
33	NSString* _schemeName;
34}
35@end
36
37
38@implementation B
39-(void) test {
40 B *b;
41 b.scheme = _schemeName; // error because of this line
42}
43@end
44
45