<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, May 5, 2016 at 4:44 PM, Michael Miller via cfe-commits <span dir="ltr"><<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">michael_miller added inline comments.<br>
<span class=""><br>
================<br>
Comment at: clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.cpp:31<br>
@@ +30,3 @@<br>
+// Convenience utility to get a RecordDecl from a QualType.<br>
+const RecordDecl *getCanonicalRecordDecl(const QualType &Type) {<br>
+  if (const auto *RT = Type.getCanonicalType()->getAs<RecordType>())<br>
----------------<br>
</span><span class="">alexfh wrote:<br>
> Is `getCanonicalType()` important here? Did you try using `QualType::getAsCXXRecordDecl()`?<br>
</span>Probably not but I didn't try it. I just moved the previous function up to the top so I didn't have to forward declare it.<br>
<br>
One thing I'm simply unsure of is whether it's possible to get a RecordDecl that's not a CXXRecordDecl in C++ code. It seems like the answer is no but that might be another reason to keep it as is if I'm wrong about that...</blockquote><div><br></div><div>It's fine to assume that all RecordDecls will be CXXRecordDecls in C++ code. </div></div></div></div>