summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/Expr.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
commitca766296180af49f525a04eeef6b64f6064b7035 (patch)
treece8973d02c0a1f47698100ef9ed2bb6d2ad32291 /clang/lib/AST/Expr.cpp
parentb524d906fe4dd4c66e606011f19f690f20c791fa (diff)
downloadbcm5719-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/AST/Expr.cpp')
-rw-r--r--clang/lib/AST/Expr.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/AST/Expr.cpp b/clang/lib/AST/Expr.cpp
index 6829557734f..078bd7c8a1b 100644
--- a/clang/lib/AST/Expr.cpp
+++ b/clang/lib/AST/Expr.cpp
@@ -1324,6 +1324,12 @@ bool Expr::isOBJCGCCandidate(ASTContext &Ctx) const {
}
}
+bool Expr::isBoundMemberFunction(ASTContext &Ctx) const {
+ if (isTypeDependent())
+ return false;
+ return isLvalue(Ctx) == Expr::LV_MemberFunction;
+}
+
static Expr::CanThrowResult MergeCanThrow(Expr::CanThrowResult CT1,
Expr::CanThrowResult CT2) {
// CanThrowResult constants are ordered so that the maximum is the correct
OpenPOWER on IntegriCloud