SFINAE out duration converting constructor if the constructor would otherwise cause a ratio compile-time overflow. This fixes LWG 2094.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@189722 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -35,6 +35,8 @@ test(const FromDuration& df, const ToDuration& d)
|
||||
}
|
||||
}
|
||||
|
||||
#if _LIBCPP_STD_VER > 11
|
||||
|
||||
template<class FromDuration, long long From, class ToDuration, long long To>
|
||||
void test_constexpr ()
|
||||
{
|
||||
@@ -49,6 +51,8 @@ void test_constexpr ()
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
int main()
|
||||
{
|
||||
test(std::chrono::milliseconds(7265000), std::chrono::hours(2));
|
||||
|
Reference in New Issue
Block a user