[cfe-commits] r130906 - /cfe/trunk/lib/Sema/Sema.cpp
Matt Beaumont-Gay
matthewbg at google.com
Wed May 4 17:59:36 PDT 2011
Author: matthewbg
Date: Wed May 4 19:59:35 2011
New Revision: 130906
URL: http://llvm.org/viewvc/llvm-project?rev=130906&view=rev
Log:
Look through block pointers and ObjC object pointers
Modified:
cfe/trunk/lib/Sema/Sema.cpp
Modified: cfe/trunk/lib/Sema/Sema.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/Sema.cpp?rev=130906&r1=130905&r2=130906&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/Sema.cpp (original)
+++ cfe/trunk/lib/Sema/Sema.cpp Wed May 4 19:59:35 2011
@@ -812,10 +812,9 @@
// 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) {
More information about the cfe-commits
mailing list