From ca766296180af49f525a04eeef6b64f6064b7035 Mon Sep 17 00:00:00 2001 From: Argyrios Kyrtzidis Date: Mon, 1 Nov 2010 18:49:26 +0000 Subject: 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 --- clang/lib/AST/Expr.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'clang/lib/AST') 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 -- cgit v1.2.3