[clang-tools-extra] r270581 - [clang-tidy] Don't rely on <array> being available.

Benjamin Kramer via cfe-commits cfe-commits at lists.llvm.org
Tue May 24 09:54:27 PDT 2016


Author: d0k
Date: Tue May 24 11:54:26 2016
New Revision: 270581

URL: http://llvm.org/viewvc/llvm-project?rev=270581&view=rev
Log:
[clang-tidy] Don't rely on <array> being available.

The STL isn't necessarily around when running tests. Make our own fake
std::array to test this.

Modified:
    clang-tools-extra/trunk/test/clang-tidy/modernize-pass-by-value.cpp

Modified: clang-tools-extra/trunk/test/clang-tidy/modernize-pass-by-value.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/modernize-pass-by-value.cpp?rev=270581&r1=270580&r2=270581&view=diff
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/modernize-pass-by-value.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/modernize-pass-by-value.cpp Tue May 24 11:54:26 2016
@@ -1,8 +1,5 @@
 // RUN: %check_clang_tidy %s modernize-pass-by-value %t -- -- -std=c++11 -fno-delayed-template-parsing
 
-// CHECK-FIXES: #include <utility>
-#include <array>
-
 namespace {
 // POD types are trivially move constructible.
 struct Movable {
@@ -193,10 +190,12 @@ struct S {
   Movable M;
 };
 
+template <typename T, int N> struct array { T A[N]; };
+
 // Test that types that are trivially copyable will not use std::move. This will
 // cause problems with misc-move-const-arg, as it will revert it.
 struct T {
-  T(std::array<int, 10> a) : a_(a) {}
-  // CHECK-FIXES: T(std::array<int, 10> a) : a_(a) {} 
-  std::array<int, 10> a_;
+  T(array<int, 10> a) : a_(a) {}
+  // CHECK-FIXES: T(array<int, 10> a) : a_(a) {}
+  array<int, 10> a_;
 };




More information about the cfe-commits mailing list