[PATCH] Better diagnostic for static function overriding thiscall virtual method

Hans Wennborg hans at chromium.org
Tue Dec 10 15:55:35 PST 2013


On Tue, Dec 10, 2013 at 3:42 PM, Richard Smith <richard at metafoo.co.uk> wrote:
> Maybe also remove the old (and now unreachable) check from `CheckFunctionDeclaration`?

It's still reachable for ABIs where static and non-static member
function have the same calling convention though.

> This slightly degrades our diagnostic in this case: we get (one error + one note) per overridden function, rather than one error + (one note per overridden function), but I can live with that.

We could also go the other way actually. We could suppress the error
from CheckOverridingFunctionAttributes if the new function is static
and rely on the existing check in CheckFunctionDeclaration to throw an
error.

This means we'd be adding a method to overridden_methods even when the
CCs don't match, but I guess that doesn't matter since the function is
static and we error out anyway.

 - Hans


> http://llvm-reviews.chandlerc.com/D2375



More information about the cfe-commits mailing list