<div dir="ltr">Sorry, It's not.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, 19 Aug 2021 at 11:21, Vitaly Buka <<a href="mailto:vitalybuka@google.com">vitalybuka@google.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Could this be a crash from this patch <a href="https://lab.llvm.org/buildbot/#/builders/85/builds/6135/steps/10/logs/stdio" target="_blank">https://lab.llvm.org/buildbot/#/builders/85/builds/6135/steps/10/logs/stdio</a> ?</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, 18 Aug 2021 at 03:53, Simon Pilgrim via cfe-commits <<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
Author: Simon Pilgrim<br>
Date: 2021-08-18T11:53:27+01:00<br>
New Revision: f22e5869a012af09e130d804bba441eff261b1fe<br>
<br>
URL: <a href="https://github.com/llvm/llvm-project/commit/f22e5869a012af09e130d804bba441eff261b1fe" rel="noreferrer" target="_blank">https://github.com/llvm/llvm-project/commit/f22e5869a012af09e130d804bba441eff261b1fe</a><br>
DIFF: <a href="https://github.com/llvm/llvm-project/commit/f22e5869a012af09e130d804bba441eff261b1fe.diff" rel="noreferrer" target="_blank">https://github.com/llvm/llvm-project/commit/f22e5869a012af09e130d804bba441eff261b1fe.diff</a><br>
<br>
LOG: [Sema] CheckObjCBridgeNSCast - fix dead code warning. NFCI.<br>
<br>
Target is only ever non-null when we find an existing type, so move its declaration inside that case, and remove the dead code where Target was always null.<br>
<br>
Added: <br>
<br>
<br>
Modified: <br>
    clang/lib/Sema/SemaExprObjC.cpp<br>
<br>
Removed: <br>
<br>
<br>
<br>
################################################################################<br>
diff  --git a/clang/lib/Sema/SemaExprObjC.cpp b/clang/lib/Sema/SemaExprObjC.cpp<br>
index 8a9c933fc93f..9e46801ea508 100644<br>
--- a/clang/lib/Sema/SemaExprObjC.cpp<br>
+++ b/clang/lib/Sema/SemaExprObjC.cpp<br>
@@ -4015,12 +4015,11 @@ static bool CheckObjCBridgeNSCast(Sema &S, QualType castType, Expr *castExpr,<br>
         if (Parm->isStr("id"))<br>
           return true;<br>
<br>
-        NamedDecl *Target = nullptr;<br>
         // Check for an existing type with this name.<br>
         LookupResult R(S, DeclarationName(Parm), SourceLocation(),<br>
                        Sema::LookupOrdinaryName);<br>
         if (S.LookupName(R, S.TUScope)) {<br>
-          Target = R.getFoundDecl();<br>
+          NamedDecl *Target = R.getFoundDecl();<br>
           if (Target && isa<ObjCInterfaceDecl>(Target)) {<br>
             ObjCInterfaceDecl *ExprClass = cast<ObjCInterfaceDecl>(Target);<br>
             if (const ObjCObjectPointerType *InterfacePointerType =<br>
@@ -4056,8 +4055,6 @@ static bool CheckObjCBridgeNSCast(Sema &S, QualType castType, Expr *castExpr,<br>
                  diag::err_objc_cf_bridged_not_interface)<br>
               << castExpr->getType() << Parm;<br>
           S.Diag(TDNDecl->getBeginLoc(), diag::note_declared_at);<br>
-          if (Target)<br>
-            S.Diag(Target->getBeginLoc(), diag::note_declared_at);<br>
         }<br>
         return true;<br>
       }<br>
<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits</a><br>
</blockquote></div>
</blockquote></div>