aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaStmt.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2010-11-01 18:49:26 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2010-11-01 18:49:26 +0000
commit11ab79030938209f50691acae0ddb65e72a58ca9 (patch)
tree3d3d5b91699328ba5b49f8fab04fa4fcbf91693f /lib/Sema/SemaStmt.cpp
parent82aa713bcda99f388836c2a30bb868d9c9974817 (diff)
Emit error when using a bound member function for something other than calling it.
Also avoids IRGen crashes due to accepting invalid code. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117943 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaStmt.cpp')
-rw-r--r--lib/Sema/SemaStmt.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Sema/SemaStmt.cpp b/lib/Sema/SemaStmt.cpp
index ddee9cca6d..4c586e5e02 100644
--- a/lib/Sema/SemaStmt.cpp
+++ b/lib/Sema/SemaStmt.cpp
@@ -74,6 +74,12 @@ void Sema::DiagnoseUnusedExprResult(const Stmt *S) {
if (!E)
return;
+ if (E->isBoundMemberFunction(Context)) {
+ Diag(E->getLocStart(), diag::err_invalid_use_of_bound_member_func)
+ << E->getSourceRange();
+ return;
+ }
+
SourceLocation Loc;
SourceRange R1, R2;
if (!E->isUnusedResultAWarning(Loc, R1, R2, Context))