diff options
author | Pavel Labath <labath@google.com> | 2016-11-24 11:22:43 +0000 |
---|---|---|
committer | Pavel Labath <labath@google.com> | 2016-11-24 11:22:43 +0000 |
commit | 11b63cd309630808d92c84dd93d14aeaec7fc2fe (patch) | |
tree | f93b1df86014e1be22a67d92d59ed91614004eda /lldb/source/Plugins/Process/gdb-remote | |
parent | 929282836ae3b3412e5435a641dd2514a6019d9c (diff) | |
download | bcm5719-llvm-11b63cd309630808d92c84dd93d14aeaec7fc2fe.tar.gz bcm5719-llvm-11b63cd309630808d92c84dd93d14aeaec7fc2fe.zip |
Attempt to fix freebsd build after r287864
the chrono library there uses long long as the underlying chrono type, but
defines int64_t as long (or the other way around, I am not sure). In any case,
this caused the implicit conversion to not trigger. This should address that.
Also fix up the relevant unit test.
llvm-svn: 287867
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote')
-rw-r--r-- | lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h index 619113da795..a73ba4e742d 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h @@ -57,9 +57,9 @@ template <typename Ratio> class Timeout : public llvm::Optional<std::chrono::duration<int64_t, Ratio>> { private: template <typename Ratio2> using Dur = std::chrono::duration<int64_t, Ratio2>; - template <typename Ratio2> + template <typename Rep2, typename Ratio2> using EnableIf = std::enable_if< - std::is_convertible<std::chrono::duration<int64_t, Ratio2>, + std::is_convertible<std::chrono::duration<Rep2, Ratio2>, std::chrono::duration<int64_t, Ratio>>::value>; using Base = llvm::Optional<Dur<Ratio>>; @@ -68,12 +68,15 @@ public: Timeout(llvm::NoneType none) : Base(none) {} Timeout(const Timeout &other) = default; - template <typename Ratio2, typename = typename EnableIf<Ratio2>::type> + template <typename Ratio2, + typename = typename EnableIf<int64_t, Ratio2>::type> Timeout(const Timeout<Ratio2> &other) : Base(other ? Base(Dur<Ratio>(*other)) : llvm::None) {} - template <typename Ratio2, typename = typename EnableIf<Ratio2>::type> - Timeout(const Dur<Ratio2> &other) : Base(Dur<Ratio>(other)) {} + template <typename Rep2, typename Ratio2, + typename = typename EnableIf<Rep2, Ratio2>::type> + Timeout(const std::chrono::duration<Rep2, Ratio2> &other) + : Base(Dur<Ratio>(other)) {} }; class GDBRemoteCommunication : public Communication { |