Skip to content

Commit a5f84b3

Browse files
authored
Disable constexpr_ops test on MSVC
1 parent e88e44c commit a5f84b3

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

test/run/constexpr_ops.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include <set>
1414
#include <string>
1515

16+
#include <boost/config.hpp>
1617
#include <boost/core/lightweight_test.hpp>
1718

1819
#ifdef __clang__
@@ -57,6 +58,11 @@ struct comparable_struct {
5758
}
5859

5960
int main() {
61+
// MSVC fails to use strucutred bindings in constexpr:
62+
//
63+
// error C2131: expression did not evaluate to a constant
64+
// pfr/detail/functional.hpp(21): note: failure was caused by a read of a variable outside its lifetime
65+
#if !defined(_MSC_VER) || (_MSC_VER >= 1927) || !BOOST_PFR_USE_CPP17
6066
test_constexpr_comparable<foo::comparable_struct>();
6167

6268
struct local_comparable_struct {
@@ -68,7 +74,7 @@ int main() {
6874
int i; short s; bool bl; int a,b,c,d,e; test_union u;
6975
};
7076
test_constexpr_comparable<local_comparable_struct>();
71-
77+
#endif
7278
return boost::report_errors();
7379
}
7480

0 commit comments

Comments
 (0)