blob: f4477d36fc1d2fd9bf02d053b9ad28c971565f74 [file] [log] [blame]
Douglas Gregor237f96c2008-11-26 23:31:11 +00001// RUN clang -fsyntax-only -verify %s
2@interface A
3@end
4
5@interface B : A
6@end
7
8int& f(A*);
9float& f(B*);
10void g(A*);
11
12int& h(A*);
13float& h(id);
14
15void test(A* a, B* b, id val) {
16 int& i1 = f(a);
17 float& f1 = f(b);
18 float& f2 = f(val);
19 g(a);
20 g(b);
21 g(val);
22 int& i2 = h(a);
23 float& f3 = h(val);
24 // int& i3 = h(b); FIXME: we match GCC here, but shouldn't this work?
25}
26
27int& cv(A*);
28float& cv(const A*);
29int& cv2(void*);
30float& cv2(const void*);
31
32void cv_test(A* a, B* b, const A* ac, const B* bc) {
33 int &i1 = cv(a);
34 int &i2 = cv(b);
35 float &f1 = cv(ac);
36 float &f2 = cv(bc);
37 int& i3 = cv2(a);
38 float& f3 = cv2(ac);
39}