[PATCH] D18584: Complete support for C++ Core Guidelines Type.6: Always initialize a member variable.

Alexander Kornienko via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 7 11:13:16 PDT 2016


alexfh added a comment.

A couple of nits.


================
Comment at: clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.cpp:181
@@ +180,3 @@
+          Init->isMemberInitializer()
+              ? static_cast<const NamedDecl *>(Init->getMember())
+              : static_cast<const NamedDecl *>(
----------------
If you're doing this to disambiguate the ternary operator, you can skip the second cast.

================
Comment at: test/clang-tidy/cppcoreguidelines-pro-type-member-init.cpp:285
@@ +284,3 @@
+union NegativeUnionInClass {
+  NegativeUnionInClass() {} // No message as a union can only initialize one member
+  int X = 0;
----------------
nit: Trailing period is missing.

Same below.


http://reviews.llvm.org/D18584





More information about the cfe-commits mailing list