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:
Howard Hinnant
2013-08-31 16:51:56 +00:00
parent 9e9d076879
commit 713f4db2e5
3 changed files with 39 additions and 3 deletions

View File

@@ -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));