From 9389ddc29ec60931e4dc418541ba3470b6b9fbe0 Mon Sep 17 00:00:00 2001 From: Matt Beaumont-Gay Date: Thu, 5 May 2011 00:59:35 +0000 Subject: [PATCH] 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 --- lib/Sema/Sema.cpp | 7 +++---- 1 file 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()) - FunTy = Ptr->getPointeeType()->getAs(); - else if (const ReferenceType *Ref = ExprTy->getAs()) - FunTy = Ref->getPointeeType()->getAs(); + QualType PointeeTy = ExprTy->getPointeeType(); + if (!PointeeTy.isNull()) + FunTy = PointeeTy->getAs(); if (!FunTy) FunTy = ExprTy->getAs(); if (!FunTy && ExprTy == Context.BoundMemberTy) { -- 2.50.1