Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wait_group doesn't build under gcc-12 #73

Closed
anarthal opened this issue Aug 14, 2023 · 3 comments
Closed

wait_group doesn't build under gcc-12 #73

anarthal opened this issue Aug 14, 2023 · 3 comments

Comments

@anarthal
Copy link

The following code:

#include <boost/async/promise.hpp>
#include <boost/async/wait_group.hpp>

static boost::async::promise<void> f()
{
    boost::async::wait_group gp;
    co_return;
}

Doesn't build under GCC12, Linux, Debug. It fails with the following error:

[build] /opt/boost-1.83-dev-with-redis/include/boost/async/detail/select.hpp: In instantiation of ‘static boost::async::detail::fork boost::async::detail::select_ranged_impl<Ct, URBG, Range>::awaitable::await_impl(boost::async::detail::select_ranged_impl<Ct, URBG, Range>::awaitable&, std::size_t) [with boost::asio::cancellation_type Ct = boost::asio::cancellation_type::all; URBG = std::mersenne_twister_engine<long unsigned int, 32, 624, 397, 31, 2567483615, 11, 4294967295, 7, 2636928640, 15, 4022730752, 18, 1812433253>&; Range = std::__cxx11::list<boost::async::promise<void> >&; std::size_t = long unsigned int]’:
[build] /opt/boost-1.83-dev-with-redis/include/boost/async/detail/select.hpp:464:31:   required from ‘bool boost::async::detail::select_ranged_impl<Ct, URBG, Range>::awaitable::await_ready() [with boost::asio::cancellation_type Ct = boost::asio::cancellation_type::all; URBG = std::mersenne_twister_engine<long unsigned int, 32, 624, 397, 31, 2567483615, 11, 4294967295, 7, 2636928640, 15, 4022730752, 18, 1812433253>&; Range = std::__cxx11::list<boost::async::promise<void> >&]’
[build] /opt/boost-1.83-dev-with-redis/include/boost/async/detail/wait_group.hpp:38:34:   required from here
[build] /opt/boost-1.83-dev-with-redis/include/boost/async/detail/select.hpp:385:25: error: ‘operator new’ is provided by ‘std::__n4861::__coroutine_traits_impl<boost::async::detail::fork, void>::promise_type’ {aka ‘boost::async::detail::fork::promise_type’} but is not usable with the function signature ‘static boost::async::detail::fork boost::async::detail::select_ranged_impl<Ct, URBG, Range>::awaitable::await_impl(boost::async::detail::select_ranged_impl<Ct, URBG, Range>::awaitable&, std::size_t) [with boost::asio::cancellation_type Ct = boost::asio::cancellation_type::all; URBG = std::mersenne_twister_engine<long unsigned int, 32, 624, 397, 31, 2567483615, 11, 4294967295, 7, 2636928640, 15, 4022730752, 18, 1812433253>&; Range = std::__cxx11::list<boost::async::promise<void> >&; std::size_t = long unsigned int]’
[build]   385 |     static detail::fork await_impl(awaitable & this_, std::size_t idx)
[build]       |                         ^~~~~~~~~~
[build] In file included from /opt/boost-1.83-dev-with-redis/include/boost/async/gather.hpp:12,
[build]                  from /opt/boost-1.83-dev-with-redis/include/boost/async/detail/wait_group.hpp:13,
[build]                  from /opt/boost-1.83-dev-with-redis/include/boost/async/wait_group.hpp:8,
[build]                  from /home/ruben/workspace/servertech-chat/server/src/listener.cpp:9:
[build] /opt/boost-1.83-dev-with-redis/include/boost/async/detail/gather.hpp: In instantiation of ‘static boost::async::detail::fork boost::async::detail::gather_ranged_impl<Range>::awaitable::await_impl(boost::async::detail::gather_ranged_impl<Range>::awaitable&, std::size_t) [with Range = std::__cxx11::list<boost::async::promise<void> >&; std::size_t = long unsigned int]’:
[build] /opt/boost-1.83-dev-with-redis/include/boost/async/detail/gather.hpp:322:33:   required from ‘bool boost::async::detail::gather_ranged_impl<Range>::awaitable::await_ready() [with Range = std::__cxx11::list<boost::async::promise<void> >&]’
[build] /opt/boost-1.83-dev-with-redis/include/boost/async/detail/wait_group.hpp:90:34:   required from here
[build] /opt/boost-1.83-dev-with-redis/include/boost/async/detail/gather.hpp:281:25: error: ‘operator new’ is provided by ‘std::__n4861::__coroutine_traits_impl<boost::async::detail::fork, void>::promise_type’ {aka ‘boost::async::detail::fork::promise_type’} but is not usable with the function signature ‘static boost::async::detail::fork boost::async::detail::gather_ranged_impl<Range>::awaitable::await_impl(boost::async::detail::gather_ranged_impl<Range>::awaitable&, std::size_t) [with Range = std::__cxx11::list<boost::async::promise<void> >&; std::size_t = long unsigned int]’
[build]   281 |     static detail::fork await_impl(awaitable & this_, std::size_t idx)

It does build under clang-17.

@klemens-morgenstern
Copy link
Collaborator

It does build under gcc-13 as well.

@klemens-morgenstern
Copy link
Collaborator

@klemens-morgenstern
Copy link
Collaborator

Done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants