From eb135023bb80ae103026d39caaf1fc6f362dffa3 Mon Sep 17 00:00:00 2001 From: David Chisnall Date: Tue, 3 Aug 2021 21:13:16 +0100 Subject: [PATCH] Fix implicit conversion that clang rejects. (#2704) With clang 11, the build fails with: ``` azure-sdk-for-cpp/sdk/core/azure-core/inc/azure/core/datetime.hpp:285:14: error: no viable conversion from returned value of type 'time_point >, duration > >::type>' (aka 'time_point::num, ratio<1, 1>::num>::value, __static_lcm::den, ratio<1, 1>::den>::value> > >') to function return type 'Azure::DateTime' return DateTime(1970) + std::chrono::seconds(posixTime); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ``` --- sdk/core/azure-core/inc/azure/core/datetime.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/core/azure-core/inc/azure/core/datetime.hpp b/sdk/core/azure-core/inc/azure/core/datetime.hpp index 4355227f4..4ed531473 100644 --- a/sdk/core/azure-core/inc/azure/core/datetime.hpp +++ b/sdk/core/azure-core/inc/azure/core/datetime.hpp @@ -282,7 +282,7 @@ namespace Core { namespace _internal { */ static DateTime PosixTimeToDateTime(int64_t posixTime) { - return DateTime(1970) + std::chrono::seconds(posixTime); + return {DateTime(1970) + std::chrono::seconds(posixTime)}; } /**