diff options
author | Alex Lorenz <arphaman@gmail.com> | 2018-07-25 21:50:44 +0000 |
---|---|---|
committer | Alex Lorenz <arphaman@gmail.com> | 2018-07-25 21:50:44 +0000 |
commit | 33b4c8a18f0d3d8a837b5f03c815935472963968 (patch) | |
tree | 7fb5ab27b8eb402f46e3d805c979d794b0da86c2 /libcxx/src/experimental/filesystem/filesystem_common.h | |
parent | 6a5368eadba4bbbf3120d207795f13853fabcb4f (diff) | |
download | bcm5719-llvm-33b4c8a18f0d3d8a837b5f03c815935472963968.tar.gz bcm5719-llvm-33b4c8a18f0d3d8a837b5f03c815935472963968.zip |
[libc++] Follow-up to r337960: specify lambda's return type to avoid
-Wc++11-narrowing warning on Darwin
The internal CI produced the following diagnostic:
error: non-constant-expression cannot be narrowed from type 'long long' to '__darwin_suseconds_t' (aka 'int') in initializer list [-Wc++11-narrowing]
struct ::timeval ConvertedTS[2] = {{TS[0].tv_sec, Convert(TS[0].tv_nsec)},
^~~~~~~~~~~~~~~~~~~~~~
llvm-svn: 337968
Diffstat (limited to 'libcxx/src/experimental/filesystem/filesystem_common.h')
-rw-r--r-- | libcxx/src/experimental/filesystem/filesystem_common.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libcxx/src/experimental/filesystem/filesystem_common.h b/libcxx/src/experimental/filesystem/filesystem_common.h index 43453a0ad0a..d330b764b76 100644 --- a/libcxx/src/experimental/filesystem/filesystem_common.h +++ b/libcxx/src/experimental/filesystem/filesystem_common.h @@ -393,7 +393,7 @@ bool set_file_times(const path& p, std::array<TimeSpec, 2> const& TS, error_code& ec) { #if !defined(_LIBCPP_USE_UTIMENSAT) using namespace chrono; - auto Convert = [](long nsec) { + auto Convert = [](long nsec) -> decltype(std::declval<::timeval>().tv_usec) { return duration_cast<microseconds>(nanoseconds(nsec)).count(); }; struct ::timeval ConvertedTS[2] = {{TS[0].tv_sec, Convert(TS[0].tv_nsec)}, |