[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 Mar 31 05:17:50 PDT 2016


alexfh added a comment.

Thank you for the patch! I'd like the original author to take a look at it, so just a couple of peanut gallery comments from me for now.


================
Comment at: clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.cpp:51
@@ +50,3 @@
+static bool
+isTriviallyConstructible(const ASTContext &Context, QualType Type) {
+  if (Type.isNull())
----------------
I wonder whether some relevant parts of SemaExprCXX.cpp could be made reusable so that you don't have to completely reimplement those.

================
Comment at: clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.cpp:56
@@ +55,3 @@
+  if (Type->isArrayType())
+    return isTriviallyConstructible(Context,
+                                        Context.getBaseElementType(Type));
----------------
Please clang-format the code.


http://reviews.llvm.org/D18584





More information about the cfe-commits mailing list