Skip to content

Commit 330a5b4

Browse files
author
Matt Beaumont-Gay
committed
Look through block pointers and ObjC object pointers
llvm-svn: 130906
1 parent 0bade02 commit 330a5b4

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

clang/lib/Sema/Sema.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -812,10 +812,9 @@ bool Sema::isExprCallable(const Expr &E, QualType &ZeroArgCallReturnTy,
812812
// but we can at least check if the type is "function of 0 arguments".
813813
QualType ExprTy = E.getType();
814814
const FunctionType *FunTy = NULL;
815-
if (const PointerType *Ptr = ExprTy->getAs<PointerType>())
816-
FunTy = Ptr->getPointeeType()->getAs<FunctionType>();
817-
else if (const ReferenceType *Ref = ExprTy->getAs<ReferenceType>())
818-
FunTy = Ref->getPointeeType()->getAs<FunctionType>();
815+
QualType PointeeTy = ExprTy->getPointeeType();
816+
if (!PointeeTy.isNull())
817+
FunTy = PointeeTy->getAs<FunctionType>();
819818
if (!FunTy)
820819
FunTy = ExprTy->getAs<FunctionType>();
821820
if (!FunTy && ExprTy == Context.BoundMemberTy) {

0 commit comments

Comments
 (0)