Clean up the error recovery at the bottom of Sema::LookupMemberExpr. This
mostly just shuffles various possibilities for recovery into a more
straightforward order, but also unifies a couple of diagnostics.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126266 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/SemaCXX/member-expr.cpp b/test/SemaCXX/member-expr.cpp
index a4a39d7..3c3eb04 100644
--- a/test/SemaCXX/member-expr.cpp
+++ b/test/SemaCXX/member-expr.cpp
@@ -28,7 +28,7 @@
A *f0();
};
int f0(B *b) {
- return b->f0->f0; // expected-error{{perhaps you meant to call this function}}
+ return b->f0->f0; // expected-error{{perhaps you meant to call it with no arguments}}
}
int i;
@@ -121,7 +121,7 @@
S fun();
int fun(int i);
int g() {
- return fun.x; // expected-error{{base of member reference is an overloaded function; perhaps you meant to call the 0-argument overload?}}
+ return fun.x; // expected-error{{base of member reference is an overloaded function; perhaps you meant to call it with no arguments?}}
}
S fun2(); // expected-note{{possibly valid overload here}}
@@ -129,4 +129,10 @@
int g2() {
return fun2.x; // expected-error{{base of member reference is an overloaded function; perhaps you meant to call it?}}
}
+
+ S fun3(int i=0);
+ int fun3(int i, int j);
+ int g3() {
+ return fun3.x; // expected-error{{base of member reference is an overloaded function; perhaps you meant to call it with no arguments?}}
+ }
}