From f9da986ca9c8d0727133107e416d4b6a07310910 Mon Sep 17 00:00:00 2001 From: Christopher Dykes Date: Fri, 19 May 2017 18:37:20 -0700 Subject: [PATCH] Work around a compiler crash in VS 2017.3 Preview 1 Summary: MSVC is being grumpy, and I want to continue to work from the preview build, so commit the workaround, as there's no significant difference. Upstream bug report: https://developercommunity.visualstudio.com/content/problem/59614/compiler-crash-when-constexpr-constructing-stdchro.html Reviewed By: yfeldblum Differential Revision: D5099876 fbshipit-source-id: 64d5573d78b14339ff3177dd910a22787463ccd2 --- folly/portability/Time.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/folly/portability/Time.cpp b/folly/portability/Time.cpp index dec1daf4..cb644929 100755 --- a/folly/portability/Time.cpp +++ b/folly/portability/Time.cpp @@ -215,7 +215,7 @@ extern "C" int clock_gettime(clockid_t clock_id, struct timespec* tp) { } const auto unanosToTimespec = [](timespec* tp, unsigned_nanos t) -> int { - static constexpr unsigned_nanos one_sec(std::chrono::seconds(1)); + static constexpr unsigned_nanos one_sec{std::chrono::seconds(1)}; tp->tv_sec = time_t(std::chrono::duration_cast(t).count()); tp->tv_nsec = long((t % one_sec).count()); -- 2.34.1