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 | 11 |
1 files changed, 11 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 4c88b907c87..032f71f0108 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 @@ -23,6 +23,13 @@ class SomewhatTrivial { SomewhatTrivial& operator=(const SomewhatTrivial&); }; +struct MoveOnlyType { + MoveOnlyType(const MoveOnlyType &) = delete; + MoveOnlyType(MoveOnlyType &&) = default; + ~MoveOnlyType(); + void constMethod() const; +}; + void positiveExpensiveConstValue(const ExpensiveToCopyType Obj); // CHECK-FIXES: void positiveExpensiveConstValue(const ExpensiveToCopyType& Obj); void positiveExpensiveConstValue(const ExpensiveToCopyType Obj) { @@ -169,3 +176,7 @@ struct NegativeDeletedMethod { NegativeDeletedMethod& operator=(NegativeDeletedMethod N) = delete; // CHECK-FIXES: NegativeDeletedMethod& operator=(NegativeDeletedMethod N) = delete; }; + +void NegativeMoveOnlyTypePassedByValue(MoveOnlyType M) { + M.constMethod(); +} |