* include/std/numeric (midpoint(T*, T*)): Fix incorrect result.
* testsuite/26_numerics/midpoint/pointer.cc: Change "compile" test
to "run".
From-SVN: r271606
2019-05-24 Jonathan Wakely <jwakely@redhat.com>
+ * include/std/numeric (midpoint(T*, T*)): Fix incorrect result.
+ * testsuite/26_numerics/midpoint/pointer.cc: Change "compile" test
+ to "run".
+
* testsuite/20_util/shared_ptr/cons/alias-rval.cc: Fix test.
* testsuite/20_util/shared_ptr/cons/alias.cc: Remove unused function.
enable_if_t<__and_v<is_object<_Tp>, bool_constant<sizeof(_Tp) != 0>>, _Tp*>
midpoint(_Tp* __a, _Tp* __b) noexcept
{
- return __a > __b ? __b + (__a - __b) / 2 : __a + (__b - __a) / 2;
+ return __a + (__b - __a) / 2;
}
#endif // C++20
// <http://www.gnu.org/licenses/>.
// { dg-options "-std=gnu++2a" }
-// { dg-do compile { target c++2a } }
+// { dg-do run { target c++2a } }
#include <numeric>
#include <climits>