From: Matt Beaumont-Gay Date: Thu, 5 May 2011 00:59:35 +0000 (+0000) Subject: Look through block pointers and ObjC object pointers X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9389ddc29ec60931e4dc418541ba3470b6b9fbe0;p=clang 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 --- 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) {