Merge pull request #9694 from ethereum/cxx-narrowing-fix-msvc

Fixes C++ narrowing conversion compile error
This commit is contained in:
chriseth 2020-08-28 16:13:34 +02:00 committed by GitHub
commit 342c4e1a29
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -265,7 +265,7 @@ BOOST_AUTO_TEST_CASE(helper_bool_result)
BoolResult r7{true}; BoolResult r7{true};
// Attention: this will implicitly convert to bool. // Attention: this will implicitly convert to bool.
BoolResult r8{"true"}; BoolResult r8("true"); // We cannot use {} initializer here because this does not allow narrowing conversion (at least MSVC breaks)
r7.merge(r8, logical_and<bool>()); r7.merge(r8, logical_and<bool>());
BOOST_REQUIRE_EQUAL(r7.get(), true); BOOST_REQUIRE_EQUAL(r7.get(), true);
BOOST_REQUIRE_EQUAL(r7.message(), ""); BOOST_REQUIRE_EQUAL(r7.message(), "");