diff options
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.cpp | 17 |
1 files changed, 17 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 dfd545ab2b7..5491cbb80c0 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 @@ -331,3 +331,20 @@ template <typename T> struct NegativeFinalImpl : public NegativeDependentTypeInterface<T> { void Method(ExpensiveToCopyType E) final {} }; + +struct PositiveConstructor { + PositiveConstructor(ExpensiveToCopyType E) : E(E) {} + // CHECK-MESSAGES: [[@LINE-1]]:43: warning: the parameter 'E' is copied + // CHECK-FIXES: PositiveConstructor(const ExpensiveToCopyType& E) : E(E) {} + + ExpensiveToCopyType E; +}; + +struct NegativeUsingConstructor : public PositiveConstructor { + using PositiveConstructor::PositiveConstructor; +}; + +void fun() { + ExpensiveToCopyType E; + NegativeUsingConstructor S(E); +} |