<div><div dir="auto">In the samples you gave in the original code review, it was always just `formatv(“Error: {0}”, E);`</div><div dir="auto"><br></div><div dir="auto">Is it always this simple and consistent?  Or do you frequently construct complex messages with many other parameters in the same format string?  If it’s always (or even often) that simple, maybe you just need a function like void `logError(Error E)`</div><br></div><div><div class="gmail_quote"><div dir="ltr">On Tue, Jul 10, 2018 at 7:03 AM Sam McCall via Phabricator <<a href="mailto:reviews@reviews.llvm.org" target="_blank">reviews@reviews.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">sammccall added a comment.<br>
<br>
An alternate approach in <a href="https://reviews.llvm.org/D49129" rel="noreferrer" target="_blank">https://reviews.llvm.org/D49129</a>: give `Error` an overloaded `operator<<` that has the same consume semantics at `toString` when passed rvalues.<br>
<br>
This makes `formatv`, `to_string`, `toString` all do basically the same thing (which is the only sensible thing to do when passed an rvalue).<br>
<br>
It does require minor changes to `formatv` and `to_string` to make them propagate the right kind of reference, but these seem reasonable.<br>
<br>
Overall I think I like that approach better than this one (more consistent, Error handling lives in Error.h). WDYT?<br>
<br>
<br>
Repository:<br>
  rL LLVM<br>
<br>
<a href="https://reviews.llvm.org/D49013" rel="noreferrer" target="_blank">https://reviews.llvm.org/D49013</a><br>
<br>
<br>
<br>
</blockquote></div>
</div>