[clang-tools-extra] [clang-tidy] Fix false positive in cppcoreguidelines-avoid-const-or-ref-data-members when detecting templated classes with inheritance (PR #115180)

Julian Schmidt via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 15 15:14:25 PST 2024


================
@@ -13,79 +13,92 @@
 using namespace clang::ast_matchers;
 
 namespace clang::tidy::cppcoreguidelines {
-namespace {
 
-AST_MATCHER(FieldDecl, isMemberOfLambda) {
-  return Node.getParent()->isLambda();
+static bool hasCopyConstructor(CXXRecordDecl const &Node) {
----------------
5chmidti wrote:

You can probably use `CXXRecordDecl::defaultedCopyConstructorIsDeleted` as well, at least for an earlier exit. (+ move ctor)

https://github.com/llvm/llvm-project/pull/115180


More information about the cfe-commits mailing list