[PATCH] D69435: [clang-tidy] New checker performance-trivially-destructible-check

Dmitri Gribenko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 31 11:38:21 PDT 2019


gribozavr2 added a comment.

LGTM modulo the isFirstDeclComment. Will approve after we resolve that discussion.



================
Comment at: clang-tools-extra/clang-tidy/performance/TriviallyDestructibleCheck.cpp:45
+          isDefaulted(),
+          unless(anyOf(isFirstDecl(), isVirtual(),
+                       ofClass(cxxRecordDecl(
----------------
The "isFirstDecl" part probably will always work, however, it is semantically not really the right predicate to check. What we want to check is where the constructor is declared -- in the class or outside the class, correct? If so, then the matcher should be looking at the DeclContext of the constructor decl.


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

https://reviews.llvm.org/D69435





More information about the cfe-commits mailing list