53ad6b1979
In C++11 constexpr functions can only have a return statement, so we need to fix __detail::ceil to make it valid in C++11. This can be done by moving the comparison and increment into a new function, __ceil_impl, and calling that with the result of the duration_cast. This would mean the standard C++17 std::chrono::ceil function would make two further calls, which would add too much overhead when not inlined. For C++17 and later use a using-declaration to add chrono::ceil to namespace __detail. For C++11 and C++14 define chrono::__detail::__ceil as a C++11-compatible constexpr function template. libstdc++-v3/ChangeLog: * include/std/chrono [C++17] (chrono::__detail::ceil): Add using declaration to make chrono::ceil available for internal use with a consistent name. (chrono::__detail::__ceil_impl): New function template. (chrono::__detail::ceil): Use __ceil_impl to compare and increment the value. Remove SFINAE constraint.