summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/test/clang-tidy/performance-unnecessary-value-param.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang-tools-extra/test/clang-tidy/performance-unnecessary-value-param.cpp')
-rw-r--r--clang-tools-extra/test/clang-tidy/performance-unnecessary-value-param.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/clang-tools-extra/test/clang-tidy/performance-unnecessary-value-param.cpp b/clang-tools-extra/test/clang-tidy/performance-unnecessary-value-param.cpp
index 48440e8615c..e33f44927ee 100644
--- a/clang-tools-extra/test/clang-tidy/performance-unnecessary-value-param.cpp
+++ b/clang-tools-extra/test/clang-tidy/performance-unnecessary-value-param.cpp
@@ -182,6 +182,19 @@ struct NegativeOverriddenMethod : public VirtualMethod {
}
};
+struct VirtualMethodWarningOnly {
+ virtual void methodWithExpensiveValueParam(ExpensiveToCopyType T) {}
+ // CHECK-MESSAGES: [[@LINE-1]]:66: warning: the parameter 'T' is copied
+ // CHECK-FIXES: virtual void methodWithExpensiveValueParam(ExpensiveToCopyType T) {}
+ virtual ~VirtualMethodWarningOnly() {}
+};
+
+struct PositiveNonVirualMethod {
+ void method(const ExpensiveToCopyType T) {}
+ // CHECK-MESSAGES: [[@LINE-1]]:41: warning: the const qualified parameter 'T' is copied
+ // CHECK-FIXES: void method(const ExpensiveToCopyType& T) {}
+};
+
struct NegativeDeletedMethod {
~NegativeDeletedMethod() {}
NegativeDeletedMethod& operator=(NegativeDeletedMethod N) = delete;
OpenPOWER on IntegriCloud