Douglas Gregor | 17ffd14 | 2011-04-27 03:24:57 +0000 | [diff] [blame^] | 1 | // RUN: %clang_cc1 -fsyntax-only -triple i386-apple-darwin9 -fobjc-gc -verify %s |
Douglas Gregor | 028ea4b | 2011-04-26 23:16:46 +0000 | [diff] [blame] | 2 | |
| 3 | void f0(__weak id *); // expected-note{{candidate function not viable: 1st argument ('id *') has no lifetime, but parameter has __weak lifetime}} |
| 4 | |
| 5 | void test_f0(id *x) { |
| 6 | f0(x); // expected-error{{no matching function for call to 'f0'}} |
| 7 | } |
| 8 | |
| 9 | @interface A |
| 10 | @end |
| 11 | |
| 12 | void f1(__weak id*); |
| 13 | void test_f1(__weak A** a) { |
| 14 | f1(a); |
| 15 | } |
| 16 | |
| 17 | @interface B : A |
| 18 | @end |
| 19 | |
| 20 | void f2(__weak A**); |
| 21 | void test_f2(__weak B** b) { |
| 22 | f2(b); |
| 23 | } |
| 24 | |