<div dir="ltr">Okay. How about this one. <a href="https://reviews.llvm.org/D31546">https://reviews.llvm.org/D31546</a></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Mar 31, 2017 at 5:56 AM, Rafael Espíndola <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:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 30 March 2017 at 18:56, Rui Ueyama <<a href="mailto:ruiu@google.com">ruiu@google.com</a>> wrote:<br>
> I tried a few different ideas. First, I tried to pass an InputFile to<br>
> check() as you suggested, but that ended up having four functions, which<br>
> looked ugly<br>
><br>
>   template <class T> T check(ErrorOr<T> E, const Twine &Prefix);<br>
>   template <class T> T check(Expected<T> E, const Twine &Prefix);<br>
>   template <class T> T check(ErrorOr<T> E, InputFile *File);<br>
>   template <class T> T check(Expected<T> E, InputFile *File);<br>
<br>
</span>I would still prefer this as it makes it impossible to get the two<br>
variables out of sync (and avoids a member variable).<br>
<br>
Cheers,<br>
Rafael<br>
</blockquote></div><br></div>