[PATCH] D72213: [clang-tidy] Add `bugprone-reserved-identifier` to flag usages of reserved C++ names

Logan Smith via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Jan 4 14:23:23 PST 2020


logan-5 added a comment.

In D72213#1804394 <https://reviews.llvm.org/D72213#1804394>, @Mordante wrote:

> I wonder what happens if the project already contains a suggested fix, for example:
>
>   #define __FOO(X) ...
>   #define _FOO(X) __FOO(X)
>   #define FOO(X) _FOO(X)
>
>
> will it suggest:
>
>   #define FOO(X) ...
>   #define FOO(X) FOO(X)
>   #define FOO(X) FOO(X)
>
>
> ?


Yes, it will. This issue was already present in the logic I factored out of readability-identifier-naming, so I chose not to address it for this PR. A future patch should add logic to ensure that the renaming checks don't recommend correcting multiple identifiers to the same thing.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D72213





More information about the cfe-commits mailing list