Anders Carlsson | 382ba41 | 2014-02-28 19:07:22 +0000 | [diff] [blame] | 1 | // 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 | |
| 22 | template<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 | |
| 31 | void func(const RetainPtr<Foo>& ptr) |
| 32 | { |
| 33 | [ptr instanceMethod1]; |
| 34 | } |
| 35 | |
| 36 | void func(const RetainPtr<id <FooTestProtocol>>& ptr) |
| 37 | { |
| 38 | [ptr instanceMethod1]; |
| 39 | } |
| 40 | |
Vassil Vassilev | 644ea61 | 2016-07-27 14:56:59 +0000 | [diff] [blame] | 41 | // RUN: %clang_cc1 -fsyntax-only -std=c++11 -code-completion-at=%s:33:8 %s -o - | FileCheck -check-prefix=CHECK-CC1 %s |
Anders Carlsson | 382ba41 | 2014-02-28 19:07:22 +0000 | [diff] [blame] | 42 | // CHECK-CC1: categoryInstanceMethod : [#id#]categoryInstanceMethod |
| 43 | // CHECK-CC1: instanceMethod1 : [#id#]instanceMethod1 |
Eric Liu | 4a7cd63 | 2018-10-24 12:57:27 +0000 | [diff] [blame] | 44 | // CHECK-CC1: protocolInstanceMethod (InBase) : [#id#]protocolInstanceMethod |
Vassil Vassilev | 644ea61 | 2016-07-27 14:56:59 +0000 | [diff] [blame] | 45 | // RUN: %clang_cc1 -fsyntax-only -std=c++11 -code-completion-at=%s:38:8 %s -o - | FileCheck -check-prefix=CHECK-CC2 %s |
Anders Carlsson | 382ba41 | 2014-02-28 19:07:22 +0000 | [diff] [blame] | 46 | // CHECK-CC2: protocolInstanceMethod : [#id#]protocolInstanceMethod |