<div class="gmail_quote">On Sat, Dec 24, 2011 at 6:13 PM, Rafael Ávila de Espíndola <span dir="ltr"><<a href="mailto:rafael.espindola@gmail.com">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">
The attached patch extends clang's warning for unused variables to cover<br>
cases where the variable type has a constructor, but it is not used. For<br>
example:<br>
<br>
struct S {<br>
  S();<br>
};<br>
S foo();<br>
void bar() {<br>
  S x = foo(); // expected-warning {{unused variable 'x'}}<br>
}<br>
<br>
I have tested the patch in clang itself and I am now testing it on<br>
firefox. Is the patch OK if there are no false positives in the firefox<br>
build?<br></blockquote><div><br></div><div>What about all of the objects whose constructor and destructor *are* the desired uses? It's not hard for me to imagine ones with a constructor alone that is the only desired side-effect....</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Cheers,<br>
Rafael<br>
<br>_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
<br></blockquote></div><br>