Index: clang-tidy/modernize/PassByValueCheck.cpp =================================================================== --- clang-tidy/modernize/PassByValueCheck.cpp +++ clang-tidy/modernize/PassByValueCheck.cpp @@ -181,6 +181,11 @@ if (!paramReferredExactlyOnce(Ctor, ParamDecl)) return; + // If the parameter is trivial to copy, don't move it. Moving a trivivally + // copyable type will cause a problem with modernize-pass-by-value + if (ParamDecl->getType().isTriviallyCopyableType(*Result.Context)) + return; + auto Diag = diag(ParamDecl->getLocStart(), "pass by value and use std::move"); // Iterate over all declarations of the constructor. Index: test/clang-tidy/modernize-pass-by-value.cpp =================================================================== --- test/clang-tidy/modernize-pass-by-value.cpp +++ test/clang-tidy/modernize-pass-by-value.cpp @@ -194,3 +194,9 @@ Movable M; }; +// Test that types that are trivially copyable will not use std::move. This will +// cause problems with misc-move-const-arg, as it will revert it. +struct T { + std::array a_; + T(std::array a) : a_(a) {} +};