diff options
Diffstat (limited to 'test/SemaObjCXX/overload.mm')
-rw-r--r-- | test/SemaObjCXX/overload.mm | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/test/SemaObjCXX/overload.mm b/test/SemaObjCXX/overload.mm index 7e79a42..960a7b2 100644 --- a/test/SemaObjCXX/overload.mm +++ b/test/SemaObjCXX/overload.mm @@ -51,12 +51,12 @@ void test0(A* a, B* b, id val) { } void test1(A* a) { - B* b = a; // expected-warning{{incompatible pointer types initializing 'A *' with an expression of type 'B *'}} + B* b = a; // expected-warning{{incompatible pointer types initializing 'B *' with an expression of type 'A *'}} B *c; c = a; // expected-warning{{incompatible pointer types assigning to 'A *' from 'B *'}} } void test2(A** ap) { - B** bp = ap; // expected-warning{{incompatible pointer types initializing 'A **' with an expression of type 'B **'}} + B** bp = ap; // expected-warning{{incompatible pointer types initializing 'B **' with an expression of type 'A **'}} bp = ap; // expected-warning{{incompatible pointer types assigning to 'A **' from 'B **'}} } @@ -149,3 +149,25 @@ namespace rdar8734046 { f2(a); } } + +namespace PR9735 { + int &f3(const A*); + float &f3(const void*); + + void test_f(B* b, const B* bc) { + int &ir1 = f3(b); + int &ir2 = f3(bc); + } +} + +@interface D : B +@end + +namespace rdar9327203 { + int &f(void* const&, int); + float &f(void* const&, long); + + void g(id x) { + int &fr = (f)(x, 0); + } +} |