[Boost-bugs] [Boost C++ Libraries] #13490: Compile error when BOOST_FIBERS_NO_ATOMICS is open

Subject: [Boost-bugs] [Boost C++ Libraries] #13490: Compile error when BOOST_FIBERS_NO_ATOMICS is open
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2018-03-23 12:30:45


#13490: Compile error when BOOST_FIBERS_NO_ATOMICS is open
-----------------------------------+---------------------
 Reporter: tdzl2003 <tdzl2003@…> | Owner: olli
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: context
  Version: Boost 1.66.0 | Severity: Problem
 Keywords: fiber,no atomic |
-----------------------------------+---------------------
 It's actually a bug about Boost::fiber but I can't find that component on
 bug page.

 include/boost/fiber/context.hpp: ln 392:

 ctx->use_count_.fetch_add( 1, std::memory_order_relaxed);

 While BOOST_FIBERS_NO_ATOMICS was defined, type of ctx->use_count_ is
 std::size_t, which is not a object and doesn't have fetch_add method, so
 this line failed to compile. There are also other compile errors, like
 remote_ready_hook_ is not defined but used at scheduler.hpp.

 full compile error is:

 {{{
 1>C:\HunterPackages\_Base\3e2037a\384d6ff\cd778ec\Install\include\boost/fiber/context.hpp(392):
 error C2228: left of '.fetch_add' must have class/struct/union
 1>
 C:\HunterPackages\_Base\3e2037a\384d6ff\cd778ec\Install\include\boost/fiber/context.hpp(392):
 note: type is 'std::size_t'
 1>C:\HunterPackages\_Base\3e2037a\384d6ff\cd778ec\Install\include\boost/fiber/context.hpp(397):
 error C2228: left of '.fetch_sub' must have class/struct/union
 1>
 C:\HunterPackages\_Base\3e2037a\384d6ff\cd778ec\Install\include\boost/fiber/context.hpp(397):
 note: type is 'std::size_t'
 1>C:\HunterPackages\_Base\3e2037a\384d6ff\cd778ec\Install\include\boost/fiber/scheduler.hpp(78):
 error C2039: 'remote_ready_hook_': is not a member of
 'boost::fibers::context'
 1>
 C:\HunterPackages\_Base\3e2037a\384d6ff\cd778ec\Install\include\boost/fiber/context.hpp(131):
 note: see declaration of 'boost::fibers::context'
 1>C:\HunterPackages\_Base\3e2037a\384d6ff\cd778ec\Install\include\boost/fiber/scheduler.hpp(78):
 error C2065: 'remote_ready_hook_': undeclared identifier
 1>C:\HunterPackages\_Base\3e2037a\384d6ff\cd778ec\Install\include\boost/fiber/scheduler.hpp(78):
 error C2975: 'PtrToMember': invalid template argument for
 'boost::intrusive::member_hook', expected compile-time constant expression
 1>
 C:\HunterPackages\_Base\3e2037a\384d6ff\cd778ec\Install\include\boost/intrusive/options.hpp(123):
 note: see declaration of 'PtrToMember'
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac10/ticket/13490>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2018-03-23 12:35:05 UTC