r218925 - Patch to warn if 'override' is missing

jahanian fjahanian at apple.com
Mon Oct 27 12:23:11 PDT 2014


> On Oct 24, 2014, at 12:04 PM, Richard Smith <richard at metafoo.co.uk> wrote:
> 
> Sorry for the delay. LGTM subject to a few comments:

Thanks for the review. In r220703.
- Fariborz

> 
> +  if (HasMethodWithOverrideControl
> +      && HasOverridingMethodWithoutOverrideControl) {
> 
> The && should be on the previous line.
> 
> +      if (!M->hasAttr<OverrideAttr>())
> +        DiagnoseAbsenceOfOverrideControl(M);
> 
> It seems strange to me to put the check for OverrideAttr here but put the check for FinalAttr and overridden functions and so on in DiagnoseAbsenceOfOverrideControl. Move this check into the function with the others?
> 
>    // expected-error at +1 {{declaration of 'SealedFunction' overrides a 'sealed' function}}
> -  virtual void SealedFunction();
> +  virtual void SealedFunction(); // expected-warning {{'SealedFunction' overrides a member function but is not marked 'override'}}
> 
> It would be nice to suppress the warning if we're also issuing an error for overriding a 'final' function. Please at least add a FIXME to the test for that so that someone fixing this later doesn't think this is deliberate.
> 



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20141027/aeb7574a/attachment.html>


More information about the cfe-commits mailing list