From: Jordan Rose Date: Tue, 31 Jul 2012 01:07:43 +0000 (+0000) Subject: Explain why ACC_bottom should never occur in diagnosing ARC casts. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2f71622dc8888e6da7ce786e42e8e9fbab075de6;p=clang Explain why ACC_bottom should never occur in diagnosing ARC casts. This is just a clarification on Fariborz's original patch, per e-mail discussion. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161016 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaExprObjC.cpp b/lib/Sema/SemaExprObjC.cpp index a50054405e..d57329b69e 100644 --- a/lib/Sema/SemaExprObjC.cpp +++ b/lib/Sema/SemaExprObjC.cpp @@ -2860,15 +2860,15 @@ diagnoseObjCARCConversion(Sema &S, SourceRange castRange, << castRange << castExpr->getSourceRange(); bool br = S.isKnownName("CFBridgingRelease"); - ACCResult CreateRule = + ACCResult CreateRule = ARCCastChecker(S.Context, exprACTC, castACTC, true).Visit(castExpr); + assert(CreateRule != ACC_bottom && "This cast should already be accepted."); if (CreateRule != ACC_plusOne) { DiagnosticBuilder DiagB = S.Diag(noteLoc, diag::note_arc_bridge); addFixitForObjCARCConversion(S, DiagB, CCK, afterLParen, castType, castExpr, "__bridge ", 0); } - assert (CreateRule != ACC_bottom); if (CreateRule != ACC_plusZero) { DiagnosticBuilder DiagB = S.Diag(br ? castExpr->getExprLoc() : noteLoc, @@ -2895,13 +2895,13 @@ diagnoseObjCARCConversion(Sema &S, SourceRange castRange, << castExpr->getSourceRange(); ACCResult CreateRule = ARCCastChecker(S.Context, exprACTC, castACTC, true).Visit(castExpr); + assert(CreateRule != ACC_bottom && "This cast should already be accepted."); if (CreateRule != ACC_plusOne) { DiagnosticBuilder DiagB = S.Diag(noteLoc, diag::note_arc_bridge); addFixitForObjCARCConversion(S, DiagB, CCK, afterLParen, castType, castExpr, "__bridge ", 0); } - assert (CreateRule != ACC_bottom); if (CreateRule != ACC_plusZero) { DiagnosticBuilder DiagB = S.Diag(br ? castExpr->getExprLoc() : noteLoc,