Author: alexfh Date: Wed Sep 20 05:16:35 2017 New Revision: 313752 URL: http://llvm.org/viewvc/llvm-project?rev=313752&view=rev Log: [clang-tidy] Fix linkage-related compiler errors in clang-tidy tests
Modified: clang-tools-extra/trunk/test/clang-tidy/misc-inefficient-algorithm.cpp clang-tools-extra/trunk/test/clang-tidy/misc-move-const-arg.cpp Modified: clang-tools-extra/trunk/test/clang-tidy/misc-inefficient-algorithm.cpp URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/misc-inefficient-algorithm.cpp?rev=313752&r1=313751&r2=313752&view=diff ============================================================================== --- clang-tools-extra/trunk/test/clang-tidy/misc-inefficient-algorithm.cpp (original) +++ clang-tools-extra/trunk/test/clang-tidy/misc-inefficient-algorithm.cpp Wed Sep 20 05:16:35 2017 @@ -43,19 +43,23 @@ template <typename K, typename V> struct 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) Modified: clang-tools-extra/trunk/test/clang-tidy/misc-move-const-arg.cpp URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/misc-move-const-arg.cpp?rev=313752&r1=313751&r2=313752&view=diff ============================================================================== --- clang-tools-extra/trunk/test/clang-tidy/misc-move-const-arg.cpp (original) +++ clang-tools-extra/trunk/test/clang-tidy/misc-move-const-arg.cpp Wed Sep 20 05:16:35 2017 @@ -10,7 +10,9 @@ template <typename _Tp> struct remove_re 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 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits