This revision was automatically updated to reflect the committed changes. Closed by commit rGd4e81097ea3d: [clang-tidy] Skip variadic ctors in modernize-use-equals-default (authored by alexander-shaposhnikov).
Changed prior to commit: https://reviews.llvm.org/D134929?vs=464115&id=464417#toc Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134929/new/ https://reviews.llvm.org/D134929 Files: clang-tools-extra/clang-tidy/modernize/UseEqualsDefaultCheck.cpp clang-tools-extra/docs/ReleaseNotes.rst clang-tools-extra/test/clang-tidy/checkers/modernize/use-equals-default.cpp Index: clang-tools-extra/test/clang-tidy/checkers/modernize/use-equals-default.cpp =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/modernize/use-equals-default.cpp +++ clang-tools-extra/test/clang-tidy/checkers/modernize/use-equals-default.cpp @@ -53,6 +53,11 @@ }; }; +// Skip variadic constructors. +struct VA { + VA(...) {} +}; + // Initializer or arguments. class IA { public: Index: clang-tools-extra/docs/ReleaseNotes.rst =================================================================== --- clang-tools-extra/docs/ReleaseNotes.rst +++ clang-tools-extra/docs/ReleaseNotes.rst @@ -145,9 +145,9 @@ check. The check now skips unions/union-like classes since in this case a default constructor - with empty body is not equivalent to the explicitly defaulted one. The check also skips - copy assignment operators with nonstandard return types. The check is restricted to - c++11-or-later. + with empty body is not equivalent to the explicitly defaulted one, variadic constructors + since they cannot be explicitly defaulted. The check also skips copy assignment operators + with nonstandard return types. The check is restricted to c++11-or-later. - Change the default behavior of :doc:`readability-avoid-const-params-in-decls <clang-tidy/checks/readability/avoid-const-params-in-decls>` to not Index: clang-tools-extra/clang-tidy/modernize/UseEqualsDefaultCheck.cpp =================================================================== --- clang-tools-extra/clang-tidy/modernize/UseEqualsDefaultCheck.cpp +++ clang-tools-extra/clang-tidy/modernize/UseEqualsDefaultCheck.cpp @@ -235,7 +235,7 @@ anyOf( // Default constructor. allOf(unless(hasAnyConstructorInitializer(isWritten())), - parameterCountIs(0)), + unless(isVariadic()), parameterCountIs(0)), // Copy constructor. allOf(isCopyConstructor(), // Discard constructors that can be used as a copy
Index: clang-tools-extra/test/clang-tidy/checkers/modernize/use-equals-default.cpp =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/modernize/use-equals-default.cpp +++ clang-tools-extra/test/clang-tidy/checkers/modernize/use-equals-default.cpp @@ -53,6 +53,11 @@ }; }; +// Skip variadic constructors. +struct VA { + VA(...) {} +}; + // Initializer or arguments. class IA { public: Index: clang-tools-extra/docs/ReleaseNotes.rst =================================================================== --- clang-tools-extra/docs/ReleaseNotes.rst +++ clang-tools-extra/docs/ReleaseNotes.rst @@ -145,9 +145,9 @@ check. The check now skips unions/union-like classes since in this case a default constructor - with empty body is not equivalent to the explicitly defaulted one. The check also skips - copy assignment operators with nonstandard return types. The check is restricted to - c++11-or-later. + with empty body is not equivalent to the explicitly defaulted one, variadic constructors + since they cannot be explicitly defaulted. The check also skips copy assignment operators + with nonstandard return types. The check is restricted to c++11-or-later. - Change the default behavior of :doc:`readability-avoid-const-params-in-decls <clang-tidy/checks/readability/avoid-const-params-in-decls>` to not Index: clang-tools-extra/clang-tidy/modernize/UseEqualsDefaultCheck.cpp =================================================================== --- clang-tools-extra/clang-tidy/modernize/UseEqualsDefaultCheck.cpp +++ clang-tools-extra/clang-tidy/modernize/UseEqualsDefaultCheck.cpp @@ -235,7 +235,7 @@ anyOf( // Default constructor. allOf(unless(hasAnyConstructorInitializer(isWritten())), - parameterCountIs(0)), + unless(isVariadic()), parameterCountIs(0)), // Copy constructor. allOf(isCopyConstructor(), // Discard constructors that can be used as a copy
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits