<div dir="ltr">Have you tested this on a large codebase? clang's -Woverloaded-virtual has been tweaked to have an acceptable noise level. gcc's version of the warning is uselessly noisy; clang's version is always one of its best diagnostics when I run it on a codebase that hasn't been built with clang before.</div>
<div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jul 30, 2014 at 1:30 PM, Aaron Ballman <span dir="ltr"><<a href="mailto:aaron@aaronballman.com" target="_blank">aaron@aaronballman.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I believe the following patch addresses a slight deficiency in our<br>
-Woverloaded-virtual warning check. Specifically, it causes the<br>
following code to warn (which matches GCC's behavior):<br>
<br>
struct base {<br>
virtual void foo(int I) {}<br>
virtual void foo(char C) {}<br>
};<br>
<br>
struct derived : public base {<br>
void foo(int I2) override {}<br>
};<br>
<br>
It does this by continuing to check other methods instead of early<br>
returning out of processing them when an exact signature match is<br>
encountered. I believe this is an improvement because it catches<br>
problems like:<br>
<br>
derived d;<br>
d.foo('1');<br>
<br>
Where derived::foo(int) is called when the user may expect<br>
base::foo(char) to be called.<br>
<span class="HOEnZb"><font color="#888888"><br>
~Aaron<br>
</font></span><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></div>