From 0c0d2a4cf0fbad6cb92dcf666b24fde8fac8b104 Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Thu, 13 Oct 2016 15:42:09 +0100 Subject: Replace non-constexpr decrement in std::chrono::floor * include/std/chrono (floor): Replace non-constexpr operation. * testsuite/20_util/duration_cast/rounding.cc: Test conversion to durations with floating pointer representations. From-SVN: r241122 --- libstdc++-v3/include/std/chrono | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libstdc++-v3/include/std') diff --git a/libstdc++-v3/include/std/chrono b/libstdc++-v3/include/std/chrono index cb8c876..ceae7f8 100644 --- a/libstdc++-v3/include/std/chrono +++ b/libstdc++-v3/include/std/chrono @@ -224,7 +224,7 @@ _GLIBCXX_END_NAMESPACE_VERSION { auto __to = chrono::duration_cast<_ToDur>(__d); if (__to > __d) - --__to; + return __to - _ToDur{1}; return __to; } -- cgit v1.1