summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/test/clang-tidy/performance-unnecessary-value-param.cpp
diff options
context:
space:
mode:
authorFelix Berger <flx@google.com>2016-05-14 22:43:50 +0000
committerFelix Berger <flx@google.com>2016-05-14 22:43:50 +0000
commit9435f5416765faf8b40552e064a7b1803fb95c1c (patch)
tree8c3b1911424b5c0a15c9ef2d3ef3e442cede92a4 /clang-tools-extra/test/clang-tidy/performance-unnecessary-value-param.cpp
parentbf8d85a0f32686c859d2bd5e025bb19f681c97d4 (diff)
downloadbcm5719-llvm-9435f5416765faf8b40552e064a7b1803fb95c1c.tar.gz
bcm5719-llvm-9435f5416765faf8b40552e064a7b1803fb95c1c.zip
[clang-tidy] TypeTraits - Type is not expensive to copy when it has a deleted copy constructor.
Reviewers: alexfh, sbenza Subscribers: etienneb, aaron.ballman, cfe-commits Differential Revision: http://reviews.llvm.org/D20170 llvm-svn: 269581
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.cpp11
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();
+}
OpenPOWER on IntegriCloud