[PATCH] D18914: [clang-tidy] new readability-redundant-inline

Samuel Benzaquen via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 29 10:20:45 PST 2019


sbenza added a comment.

In D18914#396149 <https://reviews.llvm.org/D18914#396149>, @mgehre wrote:

> ...
>  I personally think that 1) should be used, because late one could move the function definition to a source file (removing the inline) without having to touch
>  the class declaration. I can extend this patch to transform 2) and 3) into 1).
>
> Alternatively, I could add an option to choose between 1), 2) or 3).
>  What do you think?


I agree that (1) is preferred as it makes `inline` an implementation detail and doesn't pollute the class, but that is a style choice.
What we could do is transform (3) to (1). That is, if you provide _both_ `inline`s we remove one as it is redundant. That matches with the purpose of this check.

But changing (2) to (1) is not removing anything redundant, it is a style change.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D18914/new/

https://reviews.llvm.org/D18914





More information about the cfe-commits mailing list