aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/Sema.cpp
diff options
context:
space:
mode:
authorMatt Beaumont-Gay <matthewbg@google.com>2011-05-05 00:59:35 +0000
committerMatt Beaumont-Gay <matthewbg@google.com>2011-05-05 00:59:35 +0000
commit9389ddc29ec60931e4dc418541ba3470b6b9fbe0 (patch)
tree889ea1a3bb434b28f067212b57999a5ffbd56e67 /lib/Sema/Sema.cpp
parent439d3c3d76f858df5f25239f2a70f04312eacb5b (diff)
Look through block pointers and ObjC object pointers
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130906 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/Sema.cpp')
-rw-r--r--lib/Sema/Sema.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/Sema/Sema.cpp b/lib/Sema/Sema.cpp
index c47827153d..a994133afe 100644
--- a/lib/Sema/Sema.cpp
+++ b/lib/Sema/Sema.cpp
@@ -812,10 +812,9 @@ bool Sema::isExprCallable(const Expr &E, QualType &ZeroArgCallReturnTy,
// but we can at least check if the type is "function of 0 arguments".
QualType ExprTy = E.getType();
const FunctionType *FunTy = NULL;
- if (const PointerType *Ptr = ExprTy->getAs<PointerType>())
- FunTy = Ptr->getPointeeType()->getAs<FunctionType>();
- else if (const ReferenceType *Ref = ExprTy->getAs<ReferenceType>())
- FunTy = Ref->getPointeeType()->getAs<FunctionType>();
+ QualType PointeeTy = ExprTy->getPointeeType();
+ if (!PointeeTy.isNull())
+ FunTy = PointeeTy->getAs<FunctionType>();
if (!FunTy)
FunTy = ExprTy->getAs<FunctionType>();
if (!FunTy && ExprTy == Context.BoundMemberTy) {