diff --git a/test/run/constexpr_ops.cpp b/test/run/constexpr_ops.cpp index b29b434d..07d56a0b 100644 --- a/test/run/constexpr_ops.cpp +++ b/test/run/constexpr_ops.cpp @@ -13,6 +13,7 @@ #include #include +#include #include #ifdef __clang__ @@ -57,6 +58,11 @@ struct comparable_struct { } int main() { + // MSVC fails to use strucutred bindings in constexpr: + // + // error C2131: expression did not evaluate to a constant + // pfr/detail/functional.hpp(21): note: failure was caused by a read of a variable outside its lifetime +#if !defined(_MSC_VER) || (_MSC_VER >= 1927) || !BOOST_PFR_USE_CPP17 test_constexpr_comparable(); struct local_comparable_struct { @@ -68,7 +74,7 @@ int main() { int i; short s; bool bl; int a,b,c,d,e; test_union u; }; test_constexpr_comparable(); - +#endif return boost::report_errors(); }