Page MenuHomePhabricator

janosbenjaminantal (János Benjamin Antal)
User

Projects

User does not belong to any projects.

User Details

User Since
Aug 9 2020, 8:10 AM (6 w, 2 d)

Recent Activity

Mon, Aug 24

janosbenjaminantal updated the diff for D85697: [clang-tidy] Add cppcoreguidelines-prefer-scoped-enums-over-unscoped.

Fix clang-tidy issues.

Mon, Aug 24, 1:05 PM · Restricted Project, Restricted Project
janosbenjaminantal updated the diff for D85697: [clang-tidy] Add cppcoreguidelines-prefer-scoped-enums-over-unscoped.
Mon, Aug 24, 12:40 PM · Restricted Project, Restricted Project
janosbenjaminantal added a comment to D85697: [clang-tidy] Add cppcoreguidelines-prefer-scoped-enums-over-unscoped.

I addressed all of the review comments. Apart from the small fixes I extended a checker logic.

Mon, Aug 24, 12:40 PM · Restricted Project, Restricted Project

Aug 11 2020

janosbenjaminantal added a comment to D85697: [clang-tidy] Add cppcoreguidelines-prefer-scoped-enums-over-unscoped.

Is 'over-unscoped' really needed in the name, would just 'prefer-scoped-enum' be better, WDYT?

For the case of macro, you can check if the location is a macro using SourceLocation::isMacroID().

For this to work you would also need to check every single usage of the the values in the enum to make sure they are converted to use the scoped access.
You're best bet would be to actually store a map indexed by unscoped enum decls with a set of all their locations and maybe a flag to say if the fix can be applied or not.
For instance a fix couldn't be applied if any of the usages or decls are in macros.
This map could then be checked using the endOfTranslationUnit virtual method, with all the diags and fixes being spawned there.

Aug 11 2020, 3:28 AM · Restricted Project, Restricted Project

Aug 10 2020

janosbenjaminantal requested review of D85697: [clang-tidy] Add cppcoreguidelines-prefer-scoped-enums-over-unscoped.
Aug 10 2020, 5:08 PM · Restricted Project, Restricted Project