<div dir="ltr"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">How about just changing consumeError to return bool and the above becomes<br></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"> </blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">return consumeError(ExpectedSomethig)<wbr>;</blockquote><div><br><div class="gmail_extra">This seems like a good idea to me, but please make it a new function and name it errorToBool: The name is clearer, and matches the scheme for the other error idiom conversion: errorToErrorCode.</div><div class="gmail_extra"><br></div><div class="gmail_extra">-- Lang.</div><div class="gmail_extra"><br></div><div class="gmail_extra"><div class="gmail_quote">On Tue, Oct 31, 2017 at 12:21 AM, Rafael Avila de Espindola <span dir="ltr"><<a href="mailto:rafael.espindola@gmail.com" target="_blank">rafael.espindola@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">I think we need a convenience function that is the correct version of<br>
<br>
return bool(ExpectedSomethig);<br>
<br>
otherwise we have to inline the check everywhere. How about just<br>
changing consumeError to return bool and the above becomes<br>
<br>
return consumeError(ExpectedSomethig)<wbr>;<br>
<br>
Cheers,<br>
Rafael<br>
<div class="gmail-HOEnZb"><div class="gmail-h5"><br>
Nico Weber via Phabricator <<a href="mailto:reviews@reviews.llvm.org">reviews@reviews.llvm.org</a>> writes:<br>
<br>
> thakis added a comment.<br>
><br>
> <a href="https://reviews.llvm.org/rL315477" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>rL315477</a>, <a href="https://reviews.llvm.org/rL315475" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>rL315475</a>, <a href="https://reviews.llvm.org/rL315474" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>rL315474</a>, <a href="https://reviews.llvm.org/rL315473" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>rL315473</a>, <a href="https://reviews.llvm.org/rL315376" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>rL315376</a>, <a href="https://reviews.llvm.org/rL315354" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>rL315354</a> seem to not have introduced bugs of this type as far as I can tell.<br>
><br>
><br>
> <a href="https://reviews.llvm.org/D39437" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>D39437</a><br>
</div></div></blockquote></div><br></div></div></div>