[PATCH] D55793: [clang-tidy] Add duplicated access specifier readability check (PR25403)

Mateusz Maćkowski via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 18 13:45:49 PST 2018

m4tx marked an inline comment as done.
m4tx added a comment.

In D55793#1333723 <https://reviews.llvm.org/D55793#1333723>, @riccibruno wrote:

> In D55793#1333691 <https://reviews.llvm.org/D55793#1333691>, @m4tx wrote:
> > Don't use `CXXRecordDecl::accessSpecs()`, use unique comments in tests.
> Thanks! `CXXRecordDecl` is already huge and so adding iterators for a single checker is in my opinion not a good idea (especially if the alternative is actually less code).
>  Would it make sense to also issue a diagnostic where the first access specifier is redundant (ie `public` in a `struct`, and `private` in a `class`) ?

Yes, I was thinking about the same thing! However, I believe that some people may find this kind of "redundant" access specs actually more readable, so maybe it makes sense to add a check option for this to allow users to disable it?



More information about the cfe-commits mailing list