[PATCH] D26744: [clang-tidy] Fix identifier naming for initializer list member initializers.

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 16 13:13:08 PST 2016


aaron.ballman added inline comments.


================
Comment at: clang-tidy/readability/IdentifierNamingCheck.cpp:681
+
+    for (auto Init : Decl->inits()) {
+      if (!Init->isWritten() || Init->isInClassMemberInitializer())
----------------
Please use `const auto *` instead of just `auto`.


================
Comment at: test/clang-tidy/readability-identifier-naming.cpp:155
 // CHECK-FIXES: {{^}}class CMyClass {{{$}}
+public:
     my_class();
----------------
Why set the access specifier here (and below)?


================
Comment at: test/clang-tidy/readability-identifier-naming.cpp:224
+  // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: invalid case style for private member 'my_Bad_Member'
+  // CHECK-FIXES: {{^}}  t_t __my_Bad_Member;{{$}}
+  int my_Other_Bad_Member = 42;
----------------
Wait, our fix is to turn the name into a reserved identifier? That seems less-than-ideal (not that you are changing this behavior, mostly just that this will generate a new diagnostic on the fixed code).


https://reviews.llvm.org/D26744





More information about the cfe-commits mailing list