blob: bd8a7490c413e68f33f51c65f56070a5f2bfd3f4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
// RUN: clang -fsyntax-only -verify -pedantic %s
typedef signed char BOOL;
typedef int NSInteger;
@class NSString;
@protocol PBXCompletionItem
- (NSString *) name;
- (NSInteger)priority;
@end
extern NSInteger codeAssistantCaseCompareItems(id a, id b, void *context);
NSInteger codeAssistantCaseCompareItems(id<PBXCompletionItem> a, id<PBXCompletionItem> b, void *context)
{
}
#if 0
FIXME: clang needs to compare each method prototype with its definition (see below).
GCC produces the following correct warnning:
[snaroff:llvm/tools/clang] snarofflocal% cc -c test/Sema/objc-types-compatible.m
test/Sema/objc-types-compatible.m: In function ‘-[TedWantsToVerifyObjCDoesTheRightThing compareThis:withThat:]’:
test/Sema/objc-types-compatible.m:26: warning: conflicting types for ‘-(id)compareThis:(id <PBXCompletionItem>)a withThat:(id <PBXCompletionItem>)b’
test/Sema/objc-types-compatible.m:20: warning: previous declaration of ‘-(id)compareThis:(int)a withThat:(id)b’
#endif
@interface TedWantsToVerifyObjCDoesTheRightThing
- compareThis:(int)a withThat:(id)b;
@end
@implementation TedWantsToVerifyObjCDoesTheRightThing
- compareThis:(id<PBXCompletionItem>)a withThat:(id<PBXCompletionItem>)b {
return self;
}
@end
|