[PATCH] D107641: [clang-tidy] fix duplicate '{}' in cppcoreguidelines-pro-type-member-init

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 11 09:07:43 PDT 2021


aaron.ballman added inline comments.


================
Comment at: clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.cpp:439
+               [&](const FieldDecl *F) { 
+    if (!HasRecordClasMemberSet.count(F))
+    {
----------------
MTC wrote:
> I believe `DenseSet::contains` is more appropriate here.
+1 to the suggestion to use `contains()`.


================
Comment at: clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.h:79
+  // initialization.
+  llvm::DenseSet<const FieldDecl *> HasRecordClasMemberSet;
 };
----------------



CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D107641/new/

https://reviews.llvm.org/D107641



More information about the cfe-commits mailing list