diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/FixIt/fixit-function-call.cpp | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/test/FixIt/fixit-function-call.cpp b/test/FixIt/fixit-function-call.cpp index e59e21b933..d954267f0e 100644 --- a/test/FixIt/fixit-function-call.cpp +++ b/test/FixIt/fixit-function-call.cpp @@ -24,7 +24,7 @@ void f2(intTy2 *a) { // This call cannot be fixed since without resulting in null pointer dereference. // CHECK: error: no matching function for call to 'f1 -// CHECK-NOT: take the address of the argument with & +// CHECK-NOT: dereference the argument with * // CHECK-NOT: fix-it f1((int *)0); } @@ -65,16 +65,19 @@ struct B : public A { double y; }; +class C : A {}; + bool br(A &a); bool bp(A *a); bool dv(B b); -void dbcaller(A *ptra, B *ptrb) { +void dbcaller(A *ptra, B *ptrb, C &c) { B b; // CHECK: error: no matching function for call to 'br // CHECK: fix-it{{.*}}* br(ptrb); // good + // CHECK: error: no matching function for call to 'bp // CHECK: fix-it{{.*}}& bp(b); // good @@ -82,6 +85,20 @@ void dbcaller(A *ptra, B *ptrb) { // CHECK: error: no matching function for call to 'dv // CHECK-NOT: fix-it dv(ptra); // bad: base to derived + +// CHECK: error: no matching function for call to 'dv +// CHECK: remove & + dv(&b); + +// CHECK: error: no matching function for call to 'bp +// CHECK: remove * + bp(*ptra); + +// TODO: Test that we do not provide a fixit when inheritance is private. +// CHECK: error: no matching function for call to 'bp +// There should not be a fixit here: +// CHECK: fix-it + bp(c); } // CHECK: errors generated |