boostorg / boostorg/test

BOOST_TEST(a == b) failing

Open
#260 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
213
Forks
149
Avg merge
18h 17m
Merged PRs (30d)
2

Description

When performing the following comparison with Boost.Test:
std::u8string string_1{u8"abc"};
std::u8string_view string_2{u8"abc"};
BOOST_TEST(string_1 == string_2);

It generates the following error message:
usr/include/c++/9/bits/basic_string.h: In instantiation of ‘class std::__cxx11::basic_string, std::allocator >’:
/usr/local/include/boost/test/tools/cstring_comparison_op.hpp:75:1: required from ‘static bool boost::test_tools::assertion::op::EQ::value && boost::unit_test::is_cstring_comparable::value)>::type>::eval(const Lhs&, const Rhs&) [with Lhs = std::__cxx11::basic_string; Rhs = std::basic_string_view]’
/usr/local/include/boost/test/tools/assertion.hpp:354:24: required from ‘boost::test_tools::assertion::binary_expr::result_type boost::test_tools::assertion::binary_expr::value() const [with LExpr = boost::test_tools::assertion::value_expr&>; Rhs = std::basic_string_view&; OP = boost::test_tools::assertion::op::EQ, std::basic_string_view, void>; boost::test_tools::assertion::binary_expr::result_type = boost::test_tools::assertion_result]’
/usr/local/include/boost/test/tools/assertion.hpp:363:42: required from ‘boost::test_tools::assertion_result boost::test_tools::assertion::binary_expr::evaluate(bool) const [with LExpr = boost::test_tools::assertion::value_expr&>; Rhs = std::basic_string_view&; OP = boost::test_tools::assertion::op::EQ, std::basic_string_view, void>]’

Is there another way of fixing this issue other than changing the BOOST_TEST line to:
BOOST_TEST((string_1 == string_2));

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.