Author: hokein Date: Tue Apr 18 11:25:03 2017 New Revision: 300563 URL: http://llvm.org/viewvc/llvm-project?rev=300563&view=rev Log: Make the test pass on x86_64-win32 target.
Modified: clang-tools-extra/trunk/test/clang-tidy/performance-inefficient-vector-operation.cpp Modified: clang-tools-extra/trunk/test/clang-tidy/performance-inefficient-vector-operation.cpp URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/performance-inefficient-vector-operation.cpp?rev=300563&r1=300562&r2=300563&view=diff ============================================================================== --- clang-tools-extra/trunk/test/clang-tidy/performance-inefficient-vector-operation.cpp (original) +++ clang-tools-extra/trunk/test/clang-tidy/performance-inefficient-vector-operation.cpp Tue Apr 18 11:25:03 2017 @@ -1,9 +1,9 @@ -// RUN: %check_clang_tidy %s performance-inefficient-vector-operation %t -- -format-style=llvm -- -fno-ms-extensions -// FIXME: This may work with -target x86_64-win32. +// RUN: %check_clang_tidy %s performance-inefficient-vector-operation %t -- -format-style=llvm -- + +namespace std { typedef int size_t; -namespace std { template <class T> class vector { public: @@ -73,7 +73,7 @@ void f(std::vector<int>& t) { { std::vector<int> v; // CHECK-FIXES: v.reserve(t.size()); - for (size_t i = 0; i < t.size(); ++i) { + for (std::size_t i = 0; i < t.size(); ++i) { v.push_back(t[i]); // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: 'push_back' is called } @@ -81,7 +81,7 @@ void f(std::vector<int>& t) { { std::vector<int> v; // CHECK-FIXES: v.reserve(t.size() - 1); - for (size_t i = 0; i < t.size() - 1; ++i) { + for (std::size_t i = 0; i < t.size() - 1; ++i) { v.push_back(t[i]); } // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: 'push_back' is called } @@ -152,7 +152,7 @@ void f(std::vector<int>& t) { std::vector<int> v; // CHECK-FIXES-NOT: v.reserve(t.size()); // v isn't referenced in for-loop body. - for (size_t i = 0; i < t.size(); ++i) { + for (std::size_t i = 0; i < t.size(); ++i) { t.push_back(i); } } @@ -161,7 +161,7 @@ void f(std::vector<int>& t) { int k; // CHECK-FIXES-NOT: v.reserve(10); // For-loop isn't a fixable loop. - for (size_t i = 0; k < 10; ++i) { + for (std::size_t i = 0; k < 10; ++i) { v.push_back(t[i]); } } @@ -177,7 +177,7 @@ void f(std::vector<int>& t) { int k; // CHECK-FIXES-NOT: v.reserve(10); // For-loop isn't a fixable loop. - for (size_t i = 0; i < 10; ++k) { + for (std::size_t i = 0; i < 10; ++k) { v.push_back(t[i]); } } _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits