summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/test/clang-tidy
diff options
context:
space:
mode:
authorHaojian Wu <hokein@google.com>2016-03-02 14:12:17 +0000
committerHaojian Wu <hokein@google.com>2016-03-02 14:12:17 +0000
commit7d08ba274959e110dfd4929cd2318a26083e6185 (patch)
treee64a1098f2c12211ded0ad91be42e4646c4d26e4 /clang-tools-extra/test/clang-tidy
parent8f3381ed315604ff3a7853f22587d9115dd95a58 (diff)
downloadbcm5719-llvm-7d08ba274959e110dfd4929cd2318a26083e6185.tar.gz
bcm5719-llvm-7d08ba274959e110dfd4929cd2318a26083e6185.zip
[clang-tidy] Fix an assertion failure of "SLocEntry::getExpansion()" when IncludeInserter handles macro header file.
Summary: Also Fixes PR24749. Reviewers: alexfh Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D17805 llvm-svn: 262484
Diffstat (limited to 'clang-tools-extra/test/clang-tidy')
-rw-r--r--clang-tools-extra/test/clang-tidy/modernize-pass-by-value-marco-header.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/clang-tools-extra/test/clang-tidy/modernize-pass-by-value-marco-header.cpp b/clang-tools-extra/test/clang-tidy/modernize-pass-by-value-marco-header.cpp
new file mode 100644
index 00000000000..660aaa432c1
--- /dev/null
+++ b/clang-tools-extra/test/clang-tidy/modernize-pass-by-value-marco-header.cpp
@@ -0,0 +1,16 @@
+// RUN: %check_clang_tidy %s modernize-pass-by-value %t -- -- -std=c++11 -isystem %S/Inputs/Headers
+
+// CHECK-FIXES: #include <utility>
+
+#define HEADER <./a.h>
+#include HEADER
+
+struct A {
+};
+
+struct B {
+ B(const A &a) : a(a) {}
+// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: pass by value and use std::move [modernize-pass-by-value]
+// CHECK-FIXES: B(A a) : a(std::move(a)) {}
+ A a;
+};
OpenPOWER on IntegriCloud