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

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 11 07:11:25 PDT 2016


aaron.ballman added inline comments.

================
Comment at: clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.cpp:157
@@ +156,3 @@
+// Convenience utility to get a RecordDecl from a QualType.
+const RecordDecl *getRecordDecl(const QualType &Type) {
+  if (const auto *RT = Type.getCanonicalType()->getAs<RecordType>())
----------------
`getCanonicalRecordDecl()` instead? (Otherwise, this suggests the function could be replaced with `Type->getCXXRecordDecl()` at the call site, but that's not quite right because this function canonicalizes the type first.)

================
Comment at: clang-tidy/utils/Matchers.h:31
@@ +30,3 @@
+
+AST_MATCHER(CXXConstructorDecl, isUserProvided) {
+  return Node.isUserProvided();
----------------
This should go into clang\include\clang\ASTMatchers\ASTMatchers.h instead. When added there, it should get doxygen comments, appropriate test cases in clang\unittests\ASTMatchers\ASTMatchersTest.cpp, and then you should regenerate the online documentation by running clang\docs\tools\dump_ast_matchers.py.

================
Comment at: clang-tidy/utils/Matchers.h:35
@@ +34,3 @@
+
+AST_MATCHER(CXXConstructorDecl, isDelegatingConstructor) {
+  return Node.isDelegatingConstructor();
----------------
Same for this one.


http://reviews.llvm.org/D18584





More information about the cfe-commits mailing list