From 3c27391a90ec0e283a69520576831f3cc950cca1 Mon Sep 17 00:00:00 2001 From: Matt Beaumont-Gay Date: Wed, 4 May 2011 22:10:40 +0000 Subject: Implement Sema::isExprCallable. We can use this to produce nice diagnostics (and try to fixit-and-recover) in various cases where we might see "MyFunction" instead of "MyFunction()". The changes in SemaExpr are an example of how to use isExprCallable. llvm-svn: 130878 --- clang/test/SemaCXX/member-expr.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'clang/test/SemaCXX/member-expr.cpp') diff --git a/clang/test/SemaCXX/member-expr.cpp b/clang/test/SemaCXX/member-expr.cpp index 68af4152ef4..981bae7c770 100644 --- a/clang/test/SemaCXX/member-expr.cpp +++ b/clang/test/SemaCXX/member-expr.cpp @@ -124,10 +124,10 @@ namespace PR9025 { 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}} - S fun2(int i); // expected-note{{possibly valid overload here}} + S fun2(); + S fun2(int i); int g2() { - return fun2.x; // expected-error{{base of member reference is an overloaded function; perhaps you meant to call it?}} + return fun2.x; // expected-error{{base of member reference is an overloaded function; perhaps you meant to call it with no arguments?}} } S fun3(int i=0); @@ -140,4 +140,10 @@ namespace PR9025 { int g4() { return fun4.x; // expected-error{{base of member reference is a function; perhaps you meant to call it?}} } + + S fun5(int i); // expected-note{{possibly valid overload here}} + S fun5(float f); // expected-note{{possibly valid overload here}} + int g5() { + return fun5.x; // expected-error{{base of member reference is an overloaded function; perhaps you meant to call it?}} + } } -- cgit v1.2.3