Hi Richard,<div><br></div><div>I've added source ranges to the diagnostic, however I'm wary of catching cases like</div><div><br></div><div>if (&foo) {}</div><div><br></div><div>That seems too deliberate. For now I'd prefer to stick to the simple case of missing parentheses.</div>
<div><br></div><div>What do you think?</div><div><br></div><div>Cheers,</div><div>Lang.</div><div><br><div class="gmail_quote">On Mon, Nov 28, 2011 at 3:12 PM, Richard Trieu <span dir="ltr"><<a href="mailto:rtrieu@google.com">rtrieu@google.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="gmail_quote"><div><div class="h5">On Mon, Nov 28, 2011 at 1:38 PM, Lang Hames <span dir="ltr"><<a href="mailto:lhames@gmail.com" target="_blank">lhames@gmail.com</a>></span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">
This patch adds a warning for implicit conversion from functions to booleans.<div><br></div><div>Could someone take a look and let me know if anything needs fixing or improving?</div><div><br></div><div>Cheers,</div><div>

Lang. </div>
<br></div></div>_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu" target="_blank">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><div>Can this be changed to catch cases like this:</div><div><br></div><div>void foo();</div><div>if (&foo) {}</div><div><br></div><div>Also, have you thought about formatting the diagnostic to use the DiagnoseImpCast() helper functions like the other implicit cast warnings?  If you don't use it, it would be nice to add E->getSourceRange() to underline the function name.</div>

<div><br></div><div><br></div>
</blockquote></div><br></div>