From a5f84b38a669aa902175fc38322d8445c7e727a0 Mon Sep 17 00:00:00 2001 From: Antony Polukhin Date: Thu, 17 Dec 2020 20:28:38 +0300 Subject: [PATCH] Disable constexpr_ops test on MSVC --- test/run/constexpr_ops.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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(); }