summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/member-expr.cpp
diff options
context:
space:
mode:
authorMatt Beaumont-Gay <matthewbg@google.com>2011-05-04 22:10:40 +0000
committerMatt Beaumont-Gay <matthewbg@google.com>2011-05-04 22:10:40 +0000
commit3c27391a90ec0e283a69520576831f3cc950cca1 (patch)
tree3728d3ea2382f011292e04c814e1911d7cffda39 /clang/test/SemaCXX/member-expr.cpp
parent0fe4608af2edb537e725f83225a0c9d960b45c78 (diff)
downloadbcm5719-llvm-3c27391a90ec0e283a69520576831f3cc950cca1.tar.gz
bcm5719-llvm-3c27391a90ec0e283a69520576831f3cc950cca1.zip
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
Diffstat (limited to 'clang/test/SemaCXX/member-expr.cpp')
-rw-r--r--clang/test/SemaCXX/member-expr.cpp12
1 files changed, 9 insertions, 3 deletions
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?}}
+ }
}
OpenPOWER on IntegriCloud