summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/test/clang-tidy/modernize-pass-by-value-header.cpp
diff options
context:
space:
mode:
authorHaojian Wu <hokein@google.com>2016-03-02 09:01:25 +0000
committerHaojian Wu <hokein@google.com>2016-03-02 09:01:25 +0000
commit1b5b0fd174b28ae4e51433f104daa0057cea5c89 (patch)
treed09f0e9d1054a680b0d262b0f8d7566e26444e95 /clang-tools-extra/test/clang-tidy/modernize-pass-by-value-header.cpp
parente92ab2fbd324b8c3480534d866589e64ce2a9d29 (diff)
downloadbcm5719-llvm-1b5b0fd174b28ae4e51433f104daa0057cea5c89.tar.gz
bcm5719-llvm-1b5b0fd174b28ae4e51433f104daa0057cea5c89.zip
[clang-tidy] Make 'modernize-pass-by-value' fix work on header files.
Reviewers: alexfh Subscribers: jbcoe, cfe-commits Differential Revision: http://reviews.llvm.org/D17756 llvm-svn: 262470
Diffstat (limited to 'clang-tools-extra/test/clang-tidy/modernize-pass-by-value-header.cpp')
-rw-r--r--clang-tools-extra/test/clang-tidy/modernize-pass-by-value-header.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/clang-tools-extra/test/clang-tidy/modernize-pass-by-value-header.cpp b/clang-tools-extra/test/clang-tidy/modernize-pass-by-value-header.cpp
new file mode 100644
index 00000000000..91d8fcec17e
--- /dev/null
+++ b/clang-tools-extra/test/clang-tidy/modernize-pass-by-value-header.cpp
@@ -0,0 +1,8 @@
+// RUN: cp %S/Inputs/modernize-pass-by-value/header.h %T/pass-by-value-header.h
+// RUN: clang-tidy %s -checks='-*,modernize-pass-by-value' -header-filter='.*' -fix -- -std=c++11 -I %T | FileCheck %s -check-prefix=CHECK-MESSAGES -implicit-check-not="{{warning|error}}:"
+// RUN: FileCheck -input-file=%T/pass-by-value-header.h %s -check-prefix=CHECK-FIXES
+
+#include "pass-by-value-header.h"
+// CHECK-MESSAGES: :5:5: warning: pass by value and use std::move [modernize-pass-by-value]
+// CHECK-FIXES: #include <utility>
+// CHECK-FIXES: A(ThreadId tid) : threadid(std::move(tid)) {}
OpenPOWER on IntegriCloud