[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:41:29 PST 2020


logan-5 added inline comments.


================
Comment at: clang-tools-extra/test/clang-tidy/checkers/bugprone-reserved-identifier-invert.cpp:21
+// CHECK-MESSAGES: :[[@LINE-1]]:8: warning: declaration uses identifier 'Helper', which is not a reserved identifier [bugprone-reserved-identifier]
+// CHECK-FIXES: {{^}}struct __Helper {};{{$}}
+struct _helper2 {};
----------------
Mordante wrote:
> Why suggesting `__Helper` instead of  `_Helper` ?
I mostly didn't see a reason to make the check opinionated on //how// to uglify names, though I suppose now that you mention it, a smaller change to the name when possible is arguably better.


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