[PATCH] D136224: [clang-tidy] Skip private default ctors in modernize-use-equals-default
Dmitri Gribenko via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Oct 19 05:05:18 PDT 2022
gribozavr2 accepted this revision.
gribozavr2 added inline comments.
This revision is now accepted and ready to land.
================
Comment at: clang-tools-extra/clang-tidy/modernize/UseEqualsDefaultCheck.cpp:233
+ auto IsPublicOrOutOfLineUntilCPP20 =
+ LangOpts.CPlusPlus20 || LangOpts.CPlusPlus2b
+ ? cxxConstructorDecl()
----------------
You don't need to check for CPlusPlus2b. When CPlusPlus2b is set, CPlusPlus20 will be set as well.
================
Comment at: clang-tools-extra/test/clang-tidy/checkers/modernize/use-equals-default-cxx20.cpp:1
+// RUN: %check_clang_tidy -std=c++20 %s modernize-use-equals-default %t -- -- -fno-delayed-template-parsing -fexceptions
+
----------------
If you don't mind, it would be also helpful to add a test in c++17 mode that shows that the check does not suggest the fix then.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D136224/new/
https://reviews.llvm.org/D136224
More information about the cfe-commits
mailing list