From d893fc7c911c1dd6b212231e2c80a2c4a9a0bca5 Mon Sep 17 00:00:00 2001 From: John Hodge Date: Tue, 24 Sep 2024 11:37:43 +0800 Subject: [PATCH] Fix MSVC build errors --- src/hir/path.hpp | 6 ++++-- src/hir/type.hpp | 4 ++-- tools/standalone_miri/mir.cpp | 4 ++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/hir/path.hpp b/src/hir/path.hpp index 8823ffefe..23f3fdd20 100644 --- a/src/hir/path.hpp +++ b/src/hir/path.hpp @@ -39,8 +39,10 @@ class EncodedLiteralPtr { const EncodedLiteral* operator->() const { assert(p); return p; } }; TAGGED_UNION_EX(ConstGeneric, (), Infer, ( - (Infer, struct { // To be inferred - unsigned index = ~0u; + (Infer, struct InferData { // To be inferred + unsigned index; + // NOTE: Workaround for VS2014, which can't use initialiser lists when a default is specified + InferData(unsigned index=~0u): index(index) {} }), (Unevaluated, std::shared_ptr), // Unevaluated (or evaluation deferred) (Generic, GenericRef), // A single generic reference diff --git a/src/hir/type.hpp b/src/hir/type.hpp index e5df1f51a..d8f3520ff 100644 --- a/src/hir/type.hpp +++ b/src/hir/type.hpp @@ -183,8 +183,8 @@ struct TypeData_ErasedType struct TypeData_FunctionPointer { GenericParams hrls; // Higher-ranked lifetimes - bool is_unsafe = false; - bool is_variadic = false; + bool is_unsafe; + bool is_variadic; ::std::string m_abi; TypeRef m_rettype; ::std::vector m_arg_types; diff --git a/tools/standalone_miri/mir.cpp b/tools/standalone_miri/mir.cpp index ad8117f14..351c310b9 100644 --- a/tools/standalone_miri/mir.cpp +++ b/tools/standalone_miri/mir.cpp @@ -666,9 +666,9 @@ namespace MIR { (If, if( ae.cond != be.cond ) return false; - if( ae.bb0 != be.bb0 ) + if( ae.bb_true != be.bb_true ) return false; - if( ae.bb1 != be.bb1 ) + if( ae.bb_false != be.bb_false ) return false; ), (Switch,