From: Fariborz Jahanian Date: Fri, 7 Jun 2013 16:07:38 +0000 (+0000) Subject: fix up recogtion of block pointer type in my last patch. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b165fddec068f75c876063bb1a8e724cf12b3039;p=clang fix up recogtion of block pointer type in my last patch. // rdar://14085217. e-This line, and those below, will be ignored-- M lib/Sema/SemaExpr.cpp git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183531 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index 7bbbe72ac3..478464c9ac 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/lib/Sema/SemaExpr.cpp @@ -5105,9 +5105,11 @@ static QualType checkConditionalPointerCompatibility(Sema &S, ExprResult &LHS, QualType lhptee, rhptee; // Get the pointee types. + bool IsBlockPointer = false; if (const BlockPointerType *LHSBTy = LHSTy->getAs()) { lhptee = LHSBTy->getPointeeType(); rhptee = RHSTy->castAs()->getPointeeType(); + IsBlockPointer = true; } else { lhptee = LHSTy->castAs()->getPointeeType(); rhptee = RHSTy->castAs()->getPointeeType(); @@ -5149,7 +5151,7 @@ static QualType checkConditionalPointerCompatibility(Sema &S, ExprResult &LHS, // The pointer types are compatible. QualType ResultTy = CompositeTy.withCVRQualifiers(MergedCVRQual); - if (isa(LHSTy)) + if (IsBlockPointer) ResultTy = S.Context.getBlockPointerType(ResultTy); else ResultTy = S.Context.getPointerType(ResultTy);