Douglas Gregor | 377e1bd | 2011-05-08 06:09:53 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-gc -fsyntax-only -verify %s |
| 2 | |
| 3 | @interface A |
| 4 | @end |
| 5 | |
Argyrios Kyrtzidis | b8b0313 | 2011-06-24 00:08:59 +0000 | [diff] [blame] | 6 | void f0(__strong A**); // expected-note{{candidate function not viable: 1st argument ('A *__weak *') has __weak ownership, but parameter has __strong ownership}} |
Douglas Gregor | 377e1bd | 2011-05-08 06:09:53 +0000 | [diff] [blame] | 7 | |
| 8 | void test_f0() { |
| 9 | A *a; |
| 10 | static __weak A *a2; |
| 11 | f0(&a); |
| 12 | f0(&a2); // expected-error{{no matching function}} |
| 13 | } |
| 14 | |
Argyrios Kyrtzidis | b8b0313 | 2011-06-24 00:08:59 +0000 | [diff] [blame] | 15 | void f1(__weak A**); // expected-note{{candidate function not viable: 1st argument ('A *__strong *') has __strong ownership, but parameter has __weak ownership}} |
Douglas Gregor | 377e1bd | 2011-05-08 06:09:53 +0000 | [diff] [blame] | 16 | |
| 17 | void test_f1() { |
| 18 | A *a; |
| 19 | __strong A *a2; |
| 20 | f1(&a); |
| 21 | f1(&a2); // expected-error{{no matching function}} |
| 22 | } |