[PATCH] D19993: Fixed cppcoreguidelines-pro-type-member-init when checking records with indirect fields

Alexander Kornienko via cfe-commits cfe-commits at lists.llvm.org
Thu May 5 16:33:10 PDT 2016


alexfh added inline comments.

================
Comment at: clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.cpp:31
@@ +30,3 @@
+// Convenience utility to get a RecordDecl from a QualType.
+const RecordDecl *getCanonicalRecordDecl(const QualType &Type) {
+  if (const auto *RT = Type.getCanonicalType()->getAs<RecordType>())
----------------
Is `getCanonicalType()` important here? Did you try using `QualType::getAsCXXRecordDecl()`?


http://reviews.llvm.org/D19993





More information about the cfe-commits mailing list