Skip to content

ASSERT that iterator is not .end() fails to compile in v2.0.0, VERIFY built with v1.2.2 #90

@Hailios

Description

@Hailios

hey, I've updated libassert to 2.0.0 with conan from 1.2.2. some assertions that previously built, now fails to do so.

this is the offending code that now fails sto compile.

auto host_it = req.find(boost::beast::http::field::host);
ASSERT(host_it != req.end());

req is of type boost::beast::http::request<boost::beast::http::string_body>& from https://github.com/boostorg/beast/ using boost 1.84.

user/.conan2/p/b/libas3514cb9b8f850/p/include/libassert/assert.hpp: In instantiation of 'constexpr const bool libassert::detail::stringifiable<boost::beast::http::basic_fields<std::allocator<char> >::value_type>':
user/.conan2/p/b/libas3514cb9b8f850/p/include/libassert/assert.hpp:576:20:   required from 'constexpr bool libassert::detail::stringifiable_container() [with T = boost::beast::http::basic_fields<std::allocator<char> >::element]'
user/.conan2/p/b/libas3514cb9b8f850/p/include/libassert/assert.hpp:557:83:   required from 'constexpr const bool libassert::detail::stringifiable<boost::beast::http::basic_fields<std::allocator<char> >::element>'
user/.conan2/p/b/libas3514cb9b8f850/p/include/libassert/assert.hpp:576:20:   required from 'constexpr bool libassert::detail::stringifiable_container() [with T = boost::intrusive::list_iterator<boost::intrusive::bhtraits<boost::beast::http::basic_fields<std::allocator<char> >::element, boost::intrusive::list_node_traits<void*>, boost::intrusive::normal_link, boost::intrusive::dft_tag, 1>, true>]'
user/.conan2/p/b/libas3514cb9b8f850/p/include/libassert/assert.hpp:647:42:   required from 'std::string libassert::detail::generate_stringification(const T&) [with T = boost::intrusive::list_iterator<boost::intrusive::bhtraits<boost::beast::http::basic_fields<std::allocator<char> >::element, boost::intrusive::list_node_traits<void*>, boost::intrusive::normal_link, boost::intrusive::dft_tag, 1>, true>; std::string = std::__cxx11::basic_string<char>]'
user/.conan2/p/b/libas3514cb9b8f850/p/include/libassert/assert.hpp:1261:37:   required from 'libassert::binary_diagnostics_descriptor libassert::detail::generate_binary_diagnostic(const A&, const B&, std::string_view, std::string_view, std::string_view) [with A = boost::intrusive::list_iterator<boost::intrusive::bhtraits<boost::beast::http::basic_fields<std::allocator<char> >::element, boost::intrusive::list_node_traits<void*>, boost::intrusive::normal_link, boost::intrusive::dft_tag, 1>, true>; B = boost::intrusive::list_iterator<boost::intrusive::bhtraits<boost::beast::http::basic_fields<std::allocator<char> >::element, boost::intrusive::list_node_traits<void*>, boost::intrusive::normal_link, boost::intrusive::dft_tag, 1>, true>; std::string_view = std::basic_string_view<char>]'
user/.conan2/p/b/libas3514cb9b8f850/p/include/libassert/assert.hpp:1363:65:   required from 'void libassert::detail::process_assert_fail(expression_decomposer<A, B, C>&, const assert_static_parameters*, Args&& ...) [with A = boost::intrusive::list_iterator<boost::intrusive::bhtraits<boost::beast::http::basic_fields<std::allocator<char> >::element, boost::intrusive::list_node_traits<void*>, boost::intrusive::normal_link, boost::intrusive::dft_tag, 1>, true>&; B = boost::intrusive::list_iterator<boost::intrusive::bhtraits<boost::beast::http::basic_fields<std::allocator<char> >::element, boost::intrusive::list_node_traits<void*>, boost::intrusive::normal_link, boost::intrusive::dft_tag, 1>, true>; C = ops::neq; Args = {pretty_function_name_wrapper}]'
user/.conan2/p/b/libas3514cb9b8f850/p/include/libassert/assert.hpp:1416:28:   required from 'void libassert::detail::process_assert_fail_n(expression_decomposer<A, B, C>, const assert_static_parameters*, Args&& ...) [with A = boost::intrusive::list_iterator<boost::intrusive::bhtraits<boost::beast::http::basic_fields<std::allocator<char> >::element, boost::intrusive::list_node_traits<void*>, boost::intrusive::normal_link, boost::intrusive::dft_tag, 1>, true>&; B = boost::intrusive::list_iterator<boost::intrusive::bhtraits<boost::beast::http::basic_fields<std::allocator<char> >::element, boost::intrusive::list_node_traits<void*>, boost::intrusive::normal_link, boost::intrusive::dft_tag, 1>, true>; C = ops::neq; Args = {pretty_function_name_wrapper}]'
user/development/git/c++/HttpsSession.cpp:62:3:   required from here
user/.conan2/p/b/libas3514cb9b8f850/p/include/libassert/assert.hpp:560:38:   in 'constexpr' expansion of 'libassert::detail::stringifiable_container<boost::beast::http::basic_fields<std::allocator<char> >::value_type>()'
user/.conan2/p/b/libas3514cb9b8f850/p/include/libassert/assert.hpp:576:20: error: the value of 'libassert::detail::stringifiable<boost::beast::http::basic_fields<std::allocator<char> >::value_type>' is not usable in a constant expression
  576 |             return stringifiable<typename T::value_type>;
      |                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

built using

$ g++ --version
g++ (Ubuntu 13.2.0-4ubuntu3) 13.2.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions