diff options
author | Alexander Kornienko <alexfh@google.com> | 2017-09-20 12:16:35 +0000 |
---|---|---|
committer | Alexander Kornienko <alexfh@google.com> | 2017-09-20 12:16:35 +0000 |
commit | 621e55578800b970b10630d9b23edddfb152bbd7 (patch) | |
tree | 7fc36923ad9389df68b639dda6cf20ee4f5f9fbc /clang-tools-extra/test | |
parent | ceb4494786f9b90f5bcef7b76a1a704bb90b7b20 (diff) | |
download | bcm5719-llvm-621e55578800b970b10630d9b23edddfb152bbd7.tar.gz bcm5719-llvm-621e55578800b970b10630d9b23edddfb152bbd7.zip |
[clang-tidy] Fix linkage-related compiler errors in clang-tidy tests
llvm-svn: 313752
Diffstat (limited to 'clang-tools-extra/test')
-rw-r--r-- | clang-tools-extra/test/clang-tidy/misc-inefficient-algorithm.cpp | 16 | ||||
-rw-r--r-- | clang-tools-extra/test/clang-tidy/misc-move-const-arg.cpp | 4 |
2 files changed, 13 insertions, 7 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 75ca7d64738..830c79cabf3 100644 --- a/clang-tools-extra/test/clang-tidy/misc-inefficient-algorithm.cpp +++ b/clang-tools-extra/test/clang-tidy/misc-inefficient-algorithm.cpp @@ -43,19 +43,23 @@ template <typename K, typename V> struct unordered_multimap : map<K, V> {}; template <typename K, typename Cmp = less<K>> struct multiset : set<K, Cmp> {}; -template <typename FwIt, typename K> FwIt find(FwIt, FwIt, const K &); +template <typename FwIt, typename K> +FwIt find(FwIt, FwIt end, const K &) { return end; } template <typename FwIt, typename K, typename Cmp> -FwIt find(FwIt, FwIt, const K &, Cmp); +FwIt find(FwIt, FwIt end, const K &, Cmp) { return end; } -template <typename FwIt, typename Pred> FwIt find_if(FwIt, FwIt, Pred); +template <typename FwIt, typename Pred> +FwIt find_if(FwIt, FwIt end, Pred) { return end; } -template <typename FwIt, typename K> FwIt count(FwIt, FwIt, const K &); +template <typename FwIt, typename K> +unsigned count(FwIt, FwIt, const K &) { return 0; } -template <typename FwIt, typename K> FwIt lower_bound(FwIt, FwIt, const K &); +template <typename FwIt, typename K> +FwIt lower_bound(FwIt, FwIt end, const K &) { return end; } template <typename FwIt, typename K, typename Ord> -FwIt lower_bound(FwIt, FwIt, const K &, Ord); +FwIt lower_bound(FwIt, FwIt end, const K &, Ord) { return end; } } #define FIND_IN_SET(x) find(x.begin(), x.end(), 10) diff --git a/clang-tools-extra/test/clang-tidy/misc-move-const-arg.cpp b/clang-tools-extra/test/clang-tidy/misc-move-const-arg.cpp index 29b2b9214e2..bbe6c6bd865 100644 --- a/clang-tools-extra/test/clang-tidy/misc-move-const-arg.cpp +++ b/clang-tools-extra/test/clang-tidy/misc-move-const-arg.cpp @@ -10,7 +10,9 @@ template <typename _Tp> struct remove_reference<_Tp &> { typedef _Tp type; }; template <typename _Tp> struct remove_reference<_Tp &&> { typedef _Tp type; }; template <typename _Tp> -constexpr typename std::remove_reference<_Tp>::type &&move(_Tp &&__t); +constexpr typename std::remove_reference<_Tp>::type &&move(_Tp &&__t) { + return static_cast<typename std::remove_reference<_Tp>::type &&>(__t); +} } // namespace std |