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<Azure::_detail::Clock, typename common_type<duration<long, ratio<1, 10000000> >, duration<long long, ratio<1, 1> > >::type>' (aka 'time_point<Azure::_detail::Clock, duration<long long, ratio<__static_gcd<ratio<1, 10000000>::num, ratio<1, 1>::num>::value, __static_lcm<ratio<1, 10000000>::den, ratio<1, 1>::den>::value> > >') to function return type 'Azure::DateTime'
return DateTime(1970) + std::chrono::seconds(posixTime);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
This commit is contained in:
parent
31dc284164
commit
eb135023bb
@ -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)};
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
Reference in New Issue
Block a user