annotate clang/test/SemaObjC/method-lookup.m @ 207:2e18cbf3894f

LLVM12
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Tue, 08 Jun 2021 06:07:14 +0900
parents 1d019706d866
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 // RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
anatofuz
parents:
diff changeset
2 typedef signed char BOOL;
anatofuz
parents:
diff changeset
3 typedef int NSInteger;
anatofuz
parents:
diff changeset
4
anatofuz
parents:
diff changeset
5 @protocol NSObject
anatofuz
parents:
diff changeset
6 - (BOOL)isEqual:(id)object;
anatofuz
parents:
diff changeset
7 - (BOOL)respondsToSelector:(SEL)s;
anatofuz
parents:
diff changeset
8 @end
anatofuz
parents:
diff changeset
9
anatofuz
parents:
diff changeset
10 @interface NSObject <NSObject> {}
anatofuz
parents:
diff changeset
11 @end
anatofuz
parents:
diff changeset
12
anatofuz
parents:
diff changeset
13 @class NSString, NSData, NSMutableData, NSMutableDictionary, NSMutableArray;
anatofuz
parents:
diff changeset
14
anatofuz
parents:
diff changeset
15 @protocol PBXCompletionItem
anatofuz
parents:
diff changeset
16 - (NSString *) name;
anatofuz
parents:
diff changeset
17 - (NSInteger)priority;
anatofuz
parents:
diff changeset
18 - setPriority:(NSInteger)p;
anatofuz
parents:
diff changeset
19 @end
anatofuz
parents:
diff changeset
20
anatofuz
parents:
diff changeset
21 @implementation PBXCodeAssistant // expected-warning{{cannot find interface declaration for 'PBXCodeAssistant'}}
anatofuz
parents:
diff changeset
22 static NSMutableArray * recentCompletions = ((void *)0);
anatofuz
parents:
diff changeset
23 + (float) factorForRecentCompletion:(NSString *) completion
anatofuz
parents:
diff changeset
24 {
anatofuz
parents:
diff changeset
25 for (NSObject<PBXCompletionItem> * item in [self completionItems]) // expected-warning{{method '+completionItems' not found (return type defaults to 'id')}}
anatofuz
parents:
diff changeset
26 {
anatofuz
parents:
diff changeset
27 if ([item respondsToSelector:@selector(setPriority:)])
anatofuz
parents:
diff changeset
28 {
anatofuz
parents:
diff changeset
29 [(id)item setPriority:[item priority] / [PBXCodeAssistant factorForRecentCompletion:[item name]]];
anatofuz
parents:
diff changeset
30 }
anatofuz
parents:
diff changeset
31 }
anatofuz
parents:
diff changeset
32 return 0;
anatofuz
parents:
diff changeset
33 }
anatofuz
parents:
diff changeset
34 @end
anatofuz
parents:
diff changeset
35