---------- Mesaj înaintat ---------- Subiect: Re: Bug#913871: [libboost-coroutine-dev] Projects using libboost- coroutine2 fails to compile with g++8 and -std=gnu++17 Dată: vineri, 16 noiembrie 2018, 12:57:51 EET De la: Bogdan Vatra <bogdan.va...@kdab.com> To: Giovanni Mascellani <g.mascell...@gmail.com> CC: 913871-cl...@bugs.debian.org
Hi, În ziua de vineri, 16 noiembrie 2018, la 11:24:08 EET, Giovanni Mascellani a scris: > Hi, > > Il 16/11/18 08:38, Bogdan Vatra ha scritto: > > If I swicth to c++14/11 the problem vanish. > > Most probably we'll need a newer boost version (1.68)? > > We cannot know if you do not post the code which is giving you problems. > I am using coroutine2 from boost1.67 on a project compiling wich g++ 8 > and C++17 and it works. > > I am closing this report because it is too generic. If you want to > reopen, please be sure of detailing what bug you are encountering. At > this stage, it is much more probable that your code is C++17 incompatible. > > Giovanni. I have a simple example: [cpp] #include <boost/coroutine2/coroutine.hpp> using YieldType = boost::coroutines2::coroutine<int>::pull_type; class Test { public: Test() : m_coro(std::bind(&Test::callMe, this, std::placeholders::_1)) {} void callMe(YieldType &yield) {} using Call = boost::coroutines2::coroutine<int>::push_type; Call m_coro; }; int main() { Test t; return 0; } [/cpp] $ g++ test.cpp -std=gnu++14 -lboost_coroutine -lboost_context works just fine $ g++ test.cpp -std=gnu++17 -lboost_coroutine -lboost_context gives me following errors: In file included from /usr/include/boost/context/execution_context.hpp:13, from /usr/include/boost/coroutine2/detail/ pull_control_block_ecv2.hpp:14, from /usr/include/boost/coroutine2/detail/coroutine.hpp:37, from /usr/include/boost/coroutine2/coroutine.hpp:15, from test.cpp:1: /usr/include/boost/context/execution_context_v2.hpp: In instantiation of ‘boost::context::detail::transfer_t boost::context::detail::record<Ctx, StackAlloc, Fn, Params>::run(boost::context::detail::transfer_t) [with Ctx = boost::context::execution_context<int*>; StackAlloc = boost::context::basic_fixedsize_stack<boost::context::stack_traits>; Fn = boost::coroutines2::detail::push_coroutine<T>::control_block::control_block(boost::context::preallocated, StackAllocator, Fn&&) [with StackAllocator = boost::context::basic_fixedsize_stack<boost::context::stack_traits>; Fn = std::_Bind<void (Test::*(Test*, std::_Placeholder<1>)) (boost::coroutines2::detail::pull_coroutine<int>&)>; T = int]::<lambda(boost::context::execution_context<int*>, int*)>; Params = {}]’: /usr/include/boost/context/execution_context_v2.hpp:70:11: required from ‘void boost::context::detail::context_entry(boost::context::detail::transfer_t) [with Rec = boost::context::detail::record<boost::context::execution_context<int*>, boost::context::basic_fixedsize_stack<boost::context::stack_traits>, boost::coroutines2::detail::push_coroutine<T>::control_block::control_block(boost::context::preallocated, StackAllocator, Fn&&) [with StackAllocator = boost::context::basic_fixedsize_stack<boost::context::stack_traits>; Fn = std::_Bind<void (Test::*(Test*, std::_Placeholder<1>)) (boost::coroutines2::detail::pull_coroutine<int>&)>; T = int]::<lambda(boost::context::execution_context<int*>, int*)> >]’ /usr/include/boost/context/execution_context_v2.hpp:198:42: required from ‘void* boost::context::detail::context_create(boost::context::preallocated, StackAlloc, Fn&&, Params&& ...) [with Ctx = boost::context::execution_context<int*>; StackAlloc = boost::context::basic_fixedsize_stack<boost::context::stack_traits>; Fn = boost::coroutines2::detail::push_coroutine<T>::control_block::control_block(boost::context::preallocated, StackAllocator, Fn&&) [with StackAllocator = boost::context::basic_fixedsize_stack<boost::context::stack_traits>; Fn = std::_Bind<void (Test::*(Test*, std::_Placeholder<1>)) (boost::coroutines2::detail::pull_coroutine<int>&)>; T = int]::<lambda(boost::context::execution_context<int*>, int*)>; Params = {}; boost::context::detail::fcontext_t = void*]’ /usr/include/boost/context/execution_context_v2.hpp:281:59: required from ‘boost::context::execution_context<Args>::execution_context(std::allocator_arg_t, boost::context::preallocated, StackAlloc, Fn&&, Params&& ...) [with StackAlloc = boost::context::basic_fixedsize_stack<boost::context::stack_traits>; Fn = boost::coroutines2::detail::push_coroutine<T>::control_block::control_block(boost::context::preallocated, StackAllocator, Fn&&) [with StackAllocator = boost::context::basic_fixedsize_stack<boost::context::stack_traits>; Fn = std::_Bind<void (Test::*(Test*, std::_Placeholder<1>)) (boost::coroutines2::detail::pull_coroutine<int>&)>; T = int]::<lambda(boost::context::execution_context<int*>, int*)>; Params = {}; Args = {int*}]’ /usr/include/boost/coroutine2/detail/push_control_block_ecv2.ipp:111:12: required from ‘boost::coroutines2::detail::push_coroutine<T>::control_block::control_block(boost::context::preallocated, StackAllocator, Fn&&) [with StackAllocator = boost::context::basic_fixedsize_stack<boost::context::stack_traits>; Fn = std::_Bind<void (Test::*(Test*, std::_Placeholder<1>)) (boost::coroutines2::detail::pull_coroutine<int>&)>; T = int]’ /usr/include/boost/coroutine2/detail/create_control_block.ipp:50:12: required from ‘ControlBlock* boost::coroutines2::detail::create_control_block(StackAllocator, Fn&&) [with ControlBlock = boost::coroutines2::detail::push_coroutine<int>::control_block; StackAllocator = boost::context::basic_fixedsize_stack<boost::context::stack_traits>; Fn = std::_Bind<void (Test::*(Test*, std::_Placeholder<1>)) (boost::coroutines2::detail::pull_coroutine<int>&)>]’ /usr/include/boost/coroutine2/detail/push_coroutine.ipp:47:47: required from ‘boost::coroutines2::detail::push_coroutine<T>::push_coroutine(StackAllocator, Fn&&) [with StackAllocator = boost::context::basic_fixedsize_stack<boost::context::stack_traits>; Fn = std::_Bind<void (Test::*(Test*, std::_Placeholder<1>)) (boost::coroutines2::detail::pull_coroutine<int>&)>; T = int]’ /usr/include/boost/coroutine2/detail/push_coroutine.ipp:41:62: required from ‘boost::coroutines2::detail::push_coroutine<T>::push_coroutine(Fn&&) [with Fn = std::_Bind<void (Test::*(Test*, std::_Placeholder<1>)) (boost::coroutines2::detail::pull_coroutine<int>&)>; <template-parameter-2-2> = void; T = int]’ test.cpp:10:67: required from here /usr/include/boost/context/execution_context_v2.hpp:141:23: error: call of overloaded ‘apply(std::remove_reference<boost::coroutines2::detail::push_coroutine<T>::control_block::control_block(boost::context::preallocated, StackAllocator, Fn&&) [with StackAllocator = boost::context::basic_fixedsize_stack<boost::context::stack_traits>; Fn = std::_Bind<void (Test::*(Test*, std::_Placeholder<1>)) (boost::coroutines2::detail::pull_coroutine<int>&)>; T = int]::<lambda(boost::context::execution_context<int*>, int*)>&>::type, std::remove_reference<std::tuple<boost::context::execution_context<int*>&&, int*>&>::type)’ is ambiguous Ctx cc = apply( std::move( fn_), std::move( tpl) ); ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/boost/context/execution_context_v2.hpp:26, from /usr/include/boost/context/execution_context.hpp:13, from /usr/include/boost/coroutine2/detail/ pull_control_block_ecv2.hpp:14, from /usr/include/boost/coroutine2/detail/coroutine.hpp:37, from /usr/include/boost/coroutine2/coroutine.hpp:15, from test.cpp:1: /usr/include/boost/context/detail/apply.hpp:39:1: note: candidate: ‘decltype (boost::context::detail::apply_impl(forward<Fn>(fn), forward<Tpl>(tpl), boost::context::detail::make_index_sequence<std::tuple_size<typename std::decay<_Arg>::type>::value>{})) boost::context::detail::apply(Fn&&, Tpl&&) [with Fn = boost::coroutines2::detail::push_coroutine<T>::control_block::control_block(boost::context::preallocated, StackAllocator, Fn&&) [with StackAllocator = boost::context::basic_fixedsize_stack<boost::context::stack_traits>; Fn = std::_Bind<void (Test::*(Test*, std::_Placeholder<1>)) (boost::coroutines2::detail::pull_coroutine<int>&)>; T = int]::<lambda(boost::context::execution_context<int*>, int*)>; Tpl = std::tuple<boost::context::execution_context<int*>&&, int*>; decltype (boost::context::detail::apply_impl(forward<Fn>(fn), forward<Tpl>(tpl), boost::context::detail::make_index_sequence<std::tuple_size<typename std::decay<_Arg>::type>::value>{})) = boost::context::execution_context<int*>]’ apply( Fn && fn, Tpl && tpl) ^~~~~ In file included from /usr/include/c++/8/functional:54, from /usr/include/boost/context/execution_context_v2.hpp:16, from /usr/include/boost/context/execution_context.hpp:13, from /usr/include/boost/coroutine2/detail/ pull_control_block_ecv2.hpp:14, from /usr/include/boost/coroutine2/detail/coroutine.hpp:37, from /usr/include/boost/coroutine2/coroutine.hpp:15, from test.cpp:1: /usr/include/c++/8/tuple:1684:5: note: candidate: ‘constexpr decltype(auto) std::apply(_Fn&&, _Tuple&&) [with _Fn = boost::coroutines2::detail::push_coroutine<T>::control_block::control_block(boost::context::preallocated, StackAllocator, Fn&&) [with StackAllocator = boost::context::basic_fixedsize_stack<boost::context::stack_traits>; Fn = std::_Bind<void (Test::*(Test*, std::_Placeholder<1>)) (boost::coroutines2::detail::pull_coroutine<int>&)>; T = int]::<lambda(boost::context::execution_context<int*>, int*)>; _Tuple = std::tuple<boost::context::execution_context<int*>&&, int*>]’ apply(_Fn&& __f, _Tuple&& __t) ^~~~~ Cheers, BogDan. -----------------------------------------