summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/test/clang-tidy/misc-inefficient-algorithm.cpp
diff options
context:
space:
mode:
authorGabor Horvath <xazax.hun@gmail.com>2015-02-12 18:19:34 +0000
committerGabor Horvath <xazax.hun@gmail.com>2015-02-12 18:19:34 +0000
commit032951990475de8b19110be4950dc08addb13bec (patch)
treea4b391b31358170b81e237ed78b08a7da8725bae /clang-tools-extra/test/clang-tidy/misc-inefficient-algorithm.cpp
parent3c4f89d7029ad73ce25c798ab2109d3eea7d7151 (diff)
downloadbcm5719-llvm-032951990475de8b19110be4950dc08addb13bec.tar.gz
bcm5719-llvm-032951990475de8b19110be4950dc08addb13bec.zip
[clang-tidy] Fixed a false positive case in misc-inefficient-algorithm checker.
llvm-svn: 228945
Diffstat (limited to 'clang-tools-extra/test/clang-tidy/misc-inefficient-algorithm.cpp')
-rw-r--r--clang-tools-extra/test/clang-tidy/misc-inefficient-algorithm.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang-tools-extra/test/clang-tidy/misc-inefficient-algorithm.cpp b/clang-tools-extra/test/clang-tidy/misc-inefficient-algorithm.cpp
index 46a5b2a9456..4ed2fb25c9c 100644
--- a/clang-tools-extra/test/clang-tidy/misc-inefficient-algorithm.cpp
+++ b/clang-tools-extra/test/clang-tidy/misc-inefficient-algorithm.cpp
@@ -32,6 +32,9 @@ template <typename FwIt, typename K> FwIt find(FwIt, FwIt, const K &);
template <typename FwIt, typename K, typename Cmp>
FwIt find(FwIt, FwIt, const K &, Cmp);
+template <typename FwIt, typename Pred>
+FwIt find_if(FwIt, FwIt, Pred);
+
template <typename FwIt, typename K> FwIt count(FwIt, FwIt, const K &);
template <typename FwIt, typename K> FwIt lower_bound(FwIt, FwIt, const K &);
@@ -58,6 +61,7 @@ int main() {
auto c = count(s.begin(), s.end(), 43);
// CHECK-MESSAGES: :[[@LINE-1]]:12: warning: this STL algorithm call should be
// CHECK-FIXES: {{^ }}auto c = s.count(43);{{$}}
+ it = find_if(s.begin(), s.end(), [](int) { return false; });
std::multiset<int> ms;
find(ms.begin(), ms.end(), 46);
OpenPOWER on IntegriCloud