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

Congcong Cai via cfe-commits cfe-commits at lists.llvm.org
Sun Nov 17 21:43:05 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) {
----------------
HerrCai0907 wrote:

`hasSimpleCopyConstructor` includes the `defaultedCopyConstructorIsDeleted`. The first check is for template function which the flag is not be setted.

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


More information about the cfe-commits mailing list