diff options
Diffstat (limited to 'clang-tools-extra/test/clang-tidy/performance-unnecessary-value-param-delayed.cpp')
-rw-r--r-- | clang-tools-extra/test/clang-tidy/performance-unnecessary-value-param-delayed.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/clang-tools-extra/test/clang-tidy/performance-unnecessary-value-param-delayed.cpp b/clang-tools-extra/test/clang-tidy/performance-unnecessary-value-param-delayed.cpp index a712305dd15..623bf8b3082 100644 --- a/clang-tools-extra/test/clang-tidy/performance-unnecessary-value-param-delayed.cpp +++ b/clang-tools-extra/test/clang-tidy/performance-unnecessary-value-param-delayed.cpp @@ -64,6 +64,7 @@ void positiveAndNegative(const ExpensiveToCopyType ConstCopy, const ExpensiveToC struct PositiveConstValueConstructor { PositiveConstValueConstructor(const ExpensiveToCopyType ConstCopy) {} // CHECK-MESSAGES: [[@LINE-1]]:59: warning: the const qualified parameter 'ConstCopy' + // CHECK-FIXES: PositiveConstValueConstructor(const ExpensiveToCopyType& ConstCopy) {} }; template <typename T> void templateWithNonTemplatizedParameter(const ExpensiveToCopyType S, T V) { @@ -125,8 +126,17 @@ void negativeValueNonConstMethodIsCalled(ExpensiveToCopyType Obj) { Obj.nonConstMethod(); } -struct NegativeValueCopyConstructor { - NegativeValueCopyConstructor(ExpensiveToCopyType Copy) {} +struct PositiveValueUnusedConstructor { + PositiveValueUnusedConstructor(ExpensiveToCopyType Copy) {} + // CHECK-MESSAGES: [[@LINE-1]]:54: warning: the parameter 'Copy' + // CHECK-FIXES: PositiveValueUnusedConstructor(const ExpensiveToCopyType& Copy) {} +}; + +struct PositiveValueCopiedConstructor { + PositiveValueCopiedConstructor(ExpensiveToCopyType Copy) : Field(Copy) {} + // CHECK-MESSAGES: [[@LINE-1]]:54: warning: the parameter 'Copy' + // CHECK-FIXES: PositiveValueCopiedConstructor(const ExpensiveToCopyType& Copy) : Field(Copy) {} + ExpensiveToCopyType Field; }; template <typename T> |