[PATCH] D85697: [clang-tidy] Add cppcoreguidelines-prefer-scoped-enums

2020-10-22 Thread János Benjamin Antal via Phabricator via cfe-commits
janosbenjaminantal added inline comments. Comment at: clang-tools-extra/clang-tidy/cppcoreguidelines/PreferScopedEnumsCheck.cpp:91 + llvm::SmallString<128> Buffer; + const StringRef ClassInsertion{"class "}; + aaron.ballman wrote: > janosbenjaminantal wrote:

[PATCH] D85697: [clang-tidy] Add cppcoreguidelines-prefer-scoped-enums

2020-10-22 Thread János Benjamin Antal via Phabricator via cfe-commits
janosbenjaminantal added inline comments. Comment at: clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines-prefer-scoped-enums.cpp:165 + +enum class OpaqueScopedEnumWithFixedUnderlyingType : unsigned; aaron.ballman wrote: > njames93 wrote: > >

[PATCH] D85697: [clang-tidy] Add cppcoreguidelines-prefer-scoped-enums

2020-10-19 Thread János Benjamin Antal via Phabricator via cfe-commits
janosbenjaminantal added a comment. In D85697#2339055 , @aaron.ballman wrote: > I tend to be very skeptical of the value of checks that basically throw out > entire usable chunks of the base language because the check is effectively > impossible to

[PATCH] D85697: [clang-tidy] Add cppcoreguidelines-prefer-scoped-enums

2020-10-19 Thread János Benjamin Antal via Phabricator via cfe-commits
janosbenjaminantal added a comment. In D85697#2338249 , @njames93 wrote: > In D85697#2234468 , > @janosbenjaminantal wrote: > >> The known "limitations" are mostly similar to other checks: >> >> - It cannot detect

[PATCH] D85697: [clang-tidy] Add cppcoreguidelines-prefer-scoped-enums-over-unscoped

2020-08-24 Thread János Benjamin Antal via Phabricator via cfe-commits
janosbenjaminantal updated this revision to Diff 287478. janosbenjaminantal added a comment. Fix clang-tidy issues. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D85697/new/ https://reviews.llvm.org/D85697 Files:

[PATCH] D85697: [clang-tidy] Add cppcoreguidelines-prefer-scoped-enums-over-unscoped

2020-08-24 Thread János Benjamin Antal via Phabricator via cfe-commits
janosbenjaminantal updated this revision to Diff 287461. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D85697/new/ https://reviews.llvm.org/D85697 Files: clang-tools-extra/clang-tidy/cppcoreguidelines/CMakeLists.txt

[PATCH] D85697: [clang-tidy] Add cppcoreguidelines-prefer-scoped-enums-over-unscoped

2020-08-24 Thread János Benjamin Antal via Phabricator via cfe-commits
janosbenjaminantal added a comment. I addressed all of the review comments. Apart from the small fixes I extended a checker logic. The check collects the following information from every unscoped enum (into the `FoundEnumInfo` struct): 1. **The enum's definition**: Every information from an

[PATCH] D85697: [clang-tidy] Add cppcoreguidelines-prefer-scoped-enums-over-unscoped

2020-08-11 Thread János Benjamin Antal via Phabricator via cfe-commits
janosbenjaminantal added a comment. In D85697#2209272 , @njames93 wrote: > 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 >

[PATCH] D85697: [clang-tidy] Add cppcoreguidelines-prefer-scoped-enums-over-unscoped

2020-08-10 Thread János Benjamin Antal via Phabricator via cfe-commits
janosbenjaminantal created this revision. janosbenjaminantal added reviewers: alexfh, njames93, xazax.hun, Eugene.Zelenko. Herald added subscribers: cfe-commits, aaron.ballman, rnkovacs, kbarton, mgorny, nemanjai. Herald added a project: clang. janosbenjaminantal requested review of this