[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / SemaObjC / comptypes-a.m
blob18d546b02f6082e26411894a0adceafb67c22858
1 // RUN: %clang_cc1 -fsyntax-only -Wmethod-signatures -verify -pedantic -Wno-objc-root-class %s
2 typedef signed char BOOL;
3 typedef int NSInteger;
5 @class NSString;
7 @protocol PBXCompletionItem
8 - (NSString *) name;
9 - (NSInteger)priority;
10 @end
12 extern NSInteger codeAssistantCaseCompareItems(id a, id b, void *context);
14 NSInteger codeAssistantCaseCompareItems(id<PBXCompletionItem> a, id<PBXCompletionItem> b, void *context)
16   return 0;
19 @interface TedWantsToVerifyObjCDoesTheRightThing
21 - compareThis:(int)a withThat:(id)b;  // expected-note {{previous definition is here}} \
22                                       // expected-note {{previous definition is here}}
24 @end
26 @implementation TedWantsToVerifyObjCDoesTheRightThing
28 - compareThis:(id<PBXCompletionItem>)
29     a // expected-warning {{conflicting parameter types in implementation of 'compareThis:withThat:': 'int' vs 'id<PBXCompletionItem>'}}
30      withThat:(id<PBXCompletionItem>)b { // expected-warning {{conflicting parameter types in implementation of 'compareThis:withThat:': 'id' vs 'id<PBXCompletionItem>'}}
31   return self;
34 @end