Index: clang-tidy/utils/TypeTraits.cpp =================================================================== --- clang-tidy/utils/TypeTraits.cpp +++ clang-tidy/utils/TypeTraits.cpp @@ -41,7 +41,7 @@ llvm::Optional isExpensiveToCopy(QualType Type, const ASTContext &Context) { - if (Type->isDependentType()) + if (Type->isDependentType() || Type->isIncompleteType()) return llvm::None; return !Type.isTriviallyCopyableType(Context) && !classHasTrivialCopyAndDestroy(Type) && Index: test/clang-tidy/performance-unnecessary-value-param.cpp =================================================================== --- test/clang-tidy/performance-unnecessary-value-param.cpp +++ test/clang-tidy/performance-unnecessary-value-param.cpp @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy %s performance-unnecessary-value-param %t +// RUN: %check_clang_tidy %s performance-unnecessary-value-param %t -- -fix-errors -- --std=c++11 // CHECK-FIXES: #include @@ -237,3 +237,8 @@ ExpensiveToCopyType B; B = A; } + +struct IncompleteType; +void NegativeForIncompleteType(IncompleteType I) { + // CHECK-MESSAGES: [[@LINE-1]]:47: error: variable has incomplete type 'IncompleteType' [clang-diagnostic-error] +}