Bug 155017 - [check-webkit-style] Added checks for redundant virtual specifiers.
Summary: [check-webkit-style] Added checks for redundant virtual specifiers.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-03-04 07:12 PST by Konstantin Tokarev
Modified: 2016-03-04 09:58 PST (History)
6 users (show)

See Also:


Attachments
Patch (14.70 KB, patch)
2016-03-04 07:15 PST, Konstantin Tokarev
no flags Details | Formatted Diff | Diff
Patch (15.51 KB, patch)
2016-03-04 09:03 PST, Konstantin Tokarev
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Konstantin Tokarev 2016-03-04 07:12:56 PST
Added 3 new checks related to virtual, override, and final specifiers:

1. When "override" is present, "virtual" is redundant.
2. When "final" is present, "virtual" is redundant.
3. When "final" is present, "override" is redundant.

Inspiration was taken from current version of cpplint.py, from which our checker originates, but implementation of these checks is different.
Comment 1 Konstantin Tokarev 2016-03-04 07:15:43 PST
Created attachment 272852 [details]
Patch
Comment 2 Konstantin Tokarev 2016-03-04 07:41:41 PST
Comment on attachment 272852 [details]
Patch

This patch does not cover cases when declaration is definition.
Comment 3 Konstantin Tokarev 2016-03-04 09:03:25 PST
Created attachment 272995 [details]
Patch
Comment 4 Darin Adler 2016-03-04 09:08:21 PST
(In reply to comment #0)
> 3. When "final" is present, "override" is redundant.

Is that true? I didn’t realize. Will the code fail to compile if we say final but it’s not an override? My global replace did not try to address this case, but I can do that now too.
Comment 5 Konstantin Tokarev 2016-03-04 09:23:31 PST
Yes, standard says so. I've also checked clang 3.7 and g++ 4.8.
Comment 6 WebKit Commit Bot 2016-03-04 09:58:42 PST
Comment on attachment 272995 [details]
Patch

Clearing flags on attachment: 272995

Committed r197567: <http://trac.webkit.org/changeset/197567>
Comment 7 WebKit Commit Bot 2016-03-04 09:58:46 PST
All reviewed patches have been landed.  Closing bug.