<div dir="ltr">That's fair (re: cast over &*)<br><br><div class="gmail_quote"><div dir="ltr">On Sat, Mar 31, 2018 at 9:53 AM John McCall via Phabricator <<a href="mailto:reviews@reviews.llvm.org">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">rjmccall added a comment.<br>
<br>
In <a href="https://reviews.llvm.org/D45082#1053724" rel="noreferrer" target="_blank">https://reviews.llvm.org/D45082#1053724</a>, @lebedev.ri wrote:<br>
<br>
> - Rebase<br>
> - Drop comments<br>
> - Silence the warning via "*&" contraption, not by casting to the reference.<br>
><br>
>   The main question still stands, do we want to recommend everyone to use that in their codebases, or double the amount of diag flags and provide a way to silence this specific diagnostic?<br>
<br>
<br>
I think it's probably best to just provide a blessed way of silencing the warning in code and recommend that people adopt that.  A good analogue here is the use of unnecessary parentheses to silence the -Wparens warning about using '=' instead of '==' in an if-condition; we've always recognized that there are legitimate reasons to write code that way, so we just picked a code idiom that we promise will always shut the warning off and tell people to use it if they need it.<br>
<br>
I think I still prefer casting the RHS as the idiom to bless here, on the grounds that casts are the more universal "treat this as an opaque value" tool; for example, that's how you tell -Wconversion to shut up.  On the other hand, *& is certainly not something that we expect to see much of in ordinary code, so it works, and it's definitely a less annoying thing to type.<br>
<br>
<br>
Repository:<br>
  rL LLVM<br>
<br>
<a href="https://reviews.llvm.org/D45082" rel="noreferrer" target="_blank">https://reviews.llvm.org/D45082</a><br>
<br>
<br>
<br>
</blockquote></div></div>