blob: 33f392f5e0dc5362520519368ad0c108cf4d8f0b [file] [log] [blame]
Anders Carlsson382ba412014-02-28 19:07:22 +00001// Note: the run lines follow their respective tests, since line/column
2// matter in this test.
3
4@protocol FooTestProtocol
5+ protocolClassMethod;
6- protocolInstanceMethod;
7@end
8@interface Foo <FooTestProtocol> {
9 void *isa;
10}
11+ (int)classMethod1:a withKeyword:b;
12+ (void)classMethod2;
13+ new;
14- instanceMethod1;
15@end
16
17@interface Foo (FooTestCategory)
18+ categoryClassMethod;
19- categoryInstanceMethod;
20@end
21
22template<typename T> struct RetainPtr {
23 template <typename U> struct RemovePointer { typedef U Type; };
24 template <typename U> struct RemovePointer<U*> { typedef U Type; };
25
26 typedef typename RemovePointer<T>::Type* PtrType;
27
28 explicit operator PtrType() const;
29};
30
31void func(const RetainPtr<Foo>& ptr)
32{
33 [ptr instanceMethod1];
34}
35
36void func(const RetainPtr<id <FooTestProtocol>>& ptr)
37{
38 [ptr instanceMethod1];
39}
40
Vassil Vassilev644ea612016-07-27 14:56:59 +000041// RUN: %clang_cc1 -fsyntax-only -std=c++11 -code-completion-at=%s:33:8 %s -o - | FileCheck -check-prefix=CHECK-CC1 %s
Anders Carlsson382ba412014-02-28 19:07:22 +000042// CHECK-CC1: categoryInstanceMethod : [#id#]categoryInstanceMethod
43// CHECK-CC1: instanceMethod1 : [#id#]instanceMethod1
Eric Liu4a7cd632018-10-24 12:57:27 +000044// CHECK-CC1: protocolInstanceMethod (InBase) : [#id#]protocolInstanceMethod
Vassil Vassilev644ea612016-07-27 14:56:59 +000045// RUN: %clang_cc1 -fsyntax-only -std=c++11 -code-completion-at=%s:38:8 %s -o - | FileCheck -check-prefix=CHECK-CC2 %s
Anders Carlsson382ba412014-02-28 19:07:22 +000046// CHECK-CC2: protocolInstanceMethod : [#id#]protocolInstanceMethod