<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Mar 10, 2014 at 11:48 PM, Craig Topper <span dir="ltr"><<a href="mailto:craig.topper@gmail.com" target="_blank">craig.topper@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">While adding 'override' keywords I noticed some oddities with getCanonicalDecl.<div><br></div><div>
There is a non-const virtual version declared in Decl that is overridden in many places. There is also a const version in derived classes that is not virtual that just redirects to the const/virtual using const_cast.<div>

<br></div><div>This pattern breaks in FunctionDecl and CXXRecordDecl when the const version becomes virtual as well.</div><div><br></div><div>Was the original intention here to just have a single vtable entry?</div></div>
</div></blockquote><div><br></div><div>That sounds really weird, and unlikely to be intentional. It looks like the intent was probably to have only one vtable entry -- but even that is weird, since a derived class would need to override both forms if it overrides the virtual one, and the cost of the extra vtable entry is basically zero. Maybe the simpler fix would be to make the const form virtual too? Either way seems OK to me.</div>
</div></div></div>