[flang] Fix Windows build
authorpeter klausler <pklausler@nvidia.com>
Wed, 13 Oct 2021 00:14:14 +0000 (17:14 -0700)
committerpeter klausler <pklausler@nvidia.com>
Wed, 13 Oct 2021 00:16:00 +0000 (17:16 -0700)
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

index 68098da..adbeeb3 100644 (file)
@@ -47,16 +47,19 @@ public:
   constexpr Int128 &operator=(const Int128 &) = default;
   constexpr Int128 &operator=(Int128 &&) = default;
 
-  constexpr Int128(const Int128<!IS_SIGNED> &n)
+  explicit constexpr Int128(const Int128<!IS_SIGNED> &n)
+      : low_{n.low()}, high_{n.high()} {}
+  explicit constexpr Int128(Int128<!IS_SIGNED> &&n)
       : low_{n.low()}, high_{n.high()} {}
-  constexpr Int128(Int128<!IS_SIGNED> &&n) : low_{n.low()}, high_{n.high()} {}
   constexpr Int128 &operator=(const Int128<!IS_SIGNED> &n) {
     low_ = n.low();
     high_ = n.high();
+    return *this;
   }
   constexpr Int128 &operator=(Int128<!IS_SIGNED> &&n) {
     low_ = n.low();
     high_ = n.high();
+    return *this;
   }
 
   constexpr Int128 operator+() const { return *this; }