From 02410df530fbef5256711ec2220c4c34468c894c Mon Sep 17 00:00:00 2001 From: peter klausler Date: Tue, 12 Oct 2021 17:14:14 -0700 Subject: [PATCH] [flang] Fix Windows build A recently added class constructor needs to be "explicit" to prevent it from being available for use as a conversion, which is breaking the MSVC build of flang. --- flang/include/flang/Common/uint128.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/flang/include/flang/Common/uint128.h b/flang/include/flang/Common/uint128.h index 68098da..adbeeb3 100644 --- a/flang/include/flang/Common/uint128.h +++ b/flang/include/flang/Common/uint128.h @@ -47,16 +47,19 @@ public: constexpr Int128 &operator=(const Int128 &) = default; constexpr Int128 &operator=(Int128 &&) = default; - constexpr Int128(const Int128 &n) + explicit constexpr Int128(const Int128 &n) + : low_{n.low()}, high_{n.high()} {} + explicit constexpr Int128(Int128 &&n) : low_{n.low()}, high_{n.high()} {} - constexpr Int128(Int128 &&n) : low_{n.low()}, high_{n.high()} {} constexpr Int128 &operator=(const Int128 &n) { low_ = n.low(); high_ = n.high(); + return *this; } constexpr Int128 &operator=(Int128 &&n) { low_ = n.low(); high_ = n.high(); + return *this; } constexpr Int128 operator+() const { return *this; } -- 2.7.4