forked from boostorg/variant2
Fix tests when X3 is not v2d::trivially_move_assignable
This commit is contained in:
@ -229,10 +229,20 @@ int main()
|
||||
BOOST_ERROR( "`v = e1x;` failed to throw" );
|
||||
}
|
||||
catch( std::exception const& )
|
||||
{
|
||||
// X3 is not v2d::trivially_move_assignable on libstdc++ 4.x
|
||||
|
||||
if( v2d::is_trivially_move_assignable<X3>::value )
|
||||
{
|
||||
// all trivially destructible and move-assignable, no change
|
||||
BOOST_TEST_EQ( v.index(), 0 );
|
||||
}
|
||||
else
|
||||
{
|
||||
// basic guarantee; X1 is nothrow default-constructible
|
||||
BOOST_TEST_EQ( v.index(), 1 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
@ -246,10 +256,20 @@ int main()
|
||||
BOOST_ERROR( "`v = e1x;` failed to throw" );
|
||||
}
|
||||
catch( std::exception const& )
|
||||
{
|
||||
// X3 is not v2d::trivially_move_assignable on libstdc++ 4.x
|
||||
|
||||
if( v2d::is_trivially_move_assignable<X3>::value )
|
||||
{
|
||||
// all trivially destructible and move-assignable, no change
|
||||
BOOST_TEST_EQ( v.index(), 0 );
|
||||
}
|
||||
else
|
||||
{
|
||||
// basic guarantee; monostate
|
||||
BOOST_TEST_EQ( v.index(), 2 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return boost::report_errors();
|
||||
|
Reference in New Issue
Block a user