]> granicus.if.org Git - clang/commitdiff
fix up recogtion of block pointer type in my last patch.
authorFariborz Jahanian <fjahanian@apple.com>
Fri, 7 Jun 2013 16:07:38 +0000 (16:07 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Fri, 7 Jun 2013 16:07:38 +0000 (16:07 +0000)
// 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

lib/Sema/SemaExpr.cpp

index 7bbbe72ac31635f56d2ae786ff25ab3023449ee5..478464c9ac268c80c53893aa123cd6f92a7ba6e2 100644 (file)
@@ -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<BlockPointerType>()) {
     lhptee = LHSBTy->getPointeeType();
     rhptee = RHSTy->castAs<BlockPointerType>()->getPointeeType();
+    IsBlockPointer = true;
   } else {
     lhptee = LHSTy->castAs<PointerType>()->getPointeeType();
     rhptee = RHSTy->castAs<PointerType>()->getPointeeType();
@@ -5149,7 +5151,7 @@ static QualType checkConditionalPointerCompatibility(Sema &S, ExprResult &LHS,
 
   // The pointer types are compatible.
   QualType ResultTy = CompositeTy.withCVRQualifiers(MergedCVRQual);
-  if (isa<BlockPointerType>(LHSTy))
+  if (IsBlockPointer)
     ResultTy = S.Context.getBlockPointerType(ResultTy);
   else
     ResultTy = S.Context.getPointerType(ResultTy);