diff options
| author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2010-11-01 18:49:26 +0000 |
|---|---|---|
| committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2010-11-01 18:49:26 +0000 |
| commit | ca766296180af49f525a04eeef6b64f6064b7035 (patch) | |
| tree | ce8973d02c0a1f47698100ef9ed2bb6d2ad32291 /clang/lib/Sema/SemaExpr.cpp | |
| parent | b524d906fe4dd4c66e606011f19f690f20c791fa (diff) | |
| download | bcm5719-llvm-ca766296180af49f525a04eeef6b64f6064b7035.tar.gz bcm5719-llvm-ca766296180af49f525a04eeef6b64f6064b7035.zip | |
Emit error when using a bound member function for something other than calling it.
Also avoids IRGen crashes due to accepting invalid code.
llvm-svn: 117943
Diffstat (limited to 'clang/lib/Sema/SemaExpr.cpp')
| -rw-r--r-- | clang/lib/Sema/SemaExpr.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index 6f6d3714e69..9e28172c97e 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/lib/Sema/SemaExpr.cpp @@ -8206,6 +8206,10 @@ bool Sema::CheckBooleanCondition(Expr *&E, SourceLocation Loc) { DiagnoseAssignmentAsCondition(E); if (!E->isTypeDependent()) { + if (E->isBoundMemberFunction(Context)) + return Diag(E->getLocStart(), diag::err_invalid_use_of_bound_member_func) + << E->getSourceRange(); + DefaultFunctionArrayLvalueConversion(E); QualType T = E->getType(); |

