//===----------------------------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // // UNSUPPORTED: c++03, c++11, c++14, c++17 // // template // _Tp midpoint(_Tp __a, _Tp __b) noexcept // #include #include #include #include #include "test_macros.h" // Users are not supposed to provide template argument lists for // functions in the standard library (there's an exception for min and max) // However, libc++ protects against this for pointers, so we check to make // sure that our protection is working here. // In some cases midpoint(0,0) might get deduced as the pointer overload. template void test() { ASSERT_SAME_TYPE(T, decltype(std::midpoint(0, 0))); } int main(int, char**) { test(); test(); test(); test(); test(); test(); test(); test(); test(); test(); test(); test(); test(); test(); test(); test(); test(); test(); #ifndef TEST_HAS_NO_INT128 test<__int128_t>(); test<__uint128_t>(); #endif test(); test(); test(); return 0; }