blob: 4549683bb2e0adebf449181f9049f6788f9d8591 [file] [log] [blame]
Douglas Gregor377e1bd2011-05-08 06:09:53 +00001// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-gc -fsyntax-only -verify %s
2
3@interface A
4@end
5
Argyrios Kyrtzidisb8b03132011-06-24 00:08:59 +00006void f0(__strong A**); // expected-note{{candidate function not viable: 1st argument ('A *__weak *') has __weak ownership, but parameter has __strong ownership}}
Douglas Gregor377e1bd2011-05-08 06:09:53 +00007
8void test_f0() {
9 A *a;
10 static __weak A *a2;
11 f0(&a);
12 f0(&a2); // expected-error{{no matching function}}
13}
14
Argyrios Kyrtzidisb8b03132011-06-24 00:08:59 +000015void f1(__weak A**); // expected-note{{candidate function not viable: 1st argument ('A *__strong *') has __strong ownership, but parameter has __weak ownership}}
Douglas Gregor377e1bd2011-05-08 06:09:53 +000016
17void test_f1() {
18 A *a;
19 __strong A *a2;
20 f1(&a);
21 f1(&a2); // expected-error{{no matching function}}
22}