Look through block pointers and ObjC object pointers

llvm-svn: 130906
This commit is contained in:
Matt Beaumont-Gay 2011-05-05 00:59:35 +00:00
parent 0bade020a0
commit 330a5b42a5
1 changed files with 3 additions and 4 deletions

View File

@ -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) {