[PATCH] D136797: [clang-tidy] Skip template ctors in modernize-use-equals-default

Yitzhak Mandelbaum via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 27 15:16:46 PDT 2022


ymandel added inline comments.


================
Comment at: clang-tools-extra/clang-tidy/modernize/UseEqualsDefaultCheck.cpp:249
                     unless(isVariadic()), parameterCountIs(0),
+                    unless(hasParent(functionTemplateDecl())),
                     IsPublicOrOutOfLineUntilCPP20),
----------------
alexander-shaposhnikov wrote:
> ymandel wrote:
> > since this appears in both branches, can you place it above on line 244? that will also save a `hasParent` call (fwiw).
> > ```
> > unless(hasParent(anyOf(IsUnionLikeClass, functionTemplateDecl())))
> > ```
> (changed to anyOf(hasParent(...)) (hasParent(anyOf(...)) doesn't compile))
right -- you need to tell it the target type, like `hasParent(decl(anyOf(...)))`


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D136797



More information about the llvm-commits mailing list