Skip to content

Commit

Permalink
Disable constexpr_ops test on MSVC
Browse files Browse the repository at this point in the history
  • Loading branch information
apolukhin authored Dec 17, 2020
1 parent e88e44c commit a5f84b3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion test/run/constexpr_ops.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include <set>
#include <string>

#include <boost/config.hpp>
#include <boost/core/lightweight_test.hpp>

#ifdef __clang__
Expand Down Expand Up @@ -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<foo::comparable_struct>();

struct local_comparable_struct {
Expand All @@ -68,7 +74,7 @@ int main() {
int i; short s; bool bl; int a,b,c,d,e; test_union u;
};
test_constexpr_comparable<local_comparable_struct>();

#endif
return boost::report_errors();
}

Expand Down

0 comments on commit a5f84b3

Please sign in to comment.