From c64c5fd2dbdeff679abb126b935fb28acf5da6dd Mon Sep 17 00:00:00 2001 From: Nathan Lanza Date: Sat, 6 Apr 2019 16:19:33 -0700 Subject: [PATCH] Add WIN32 to the check for a C++ stdlib workaround This same bug occurs with clang-cl master (as of 4/6/2019). Add WIN32 to the list of checks to opt into the workaround behavior. --- src/utils.hh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/utils.hh b/src/utils.hh index 7834837e..1d9f3c3f 100644 --- a/src/utils.hh +++ b/src/utils.hh @@ -144,9 +144,10 @@ public: template struct Vec { std::unique_ptr a; int s = 0; -#if !(__clang__ || __GNUC__ > 7 || __GNUC__ == 7 && __GNUC_MINOR__ >= 4) - // Work around a bug in GCC<7.4 that optional would not be - // construtible. +#if !(__clang__ || __GNUC__ > 7 || __GNUC__ == 7 && __GNUC_MINOR__ >= 4) || \ + WIN32 + // Work around a bug in GCC<7.4 and MSVC/clang-cl that optional + // would not be construtible. Vec() = default; Vec(const Vec &o) : a(std::make_unique(o.s)), s(o.s) { std::copy(o.a.get(), o.a.get() + o.s, a.get());