Modify

Ticket #5274 (closed Bugs: fixed)

Opened 3 years ago

Last modified 20 months ago

failed to compile future.hpp with stlport 5.1.5 under msvc8.1, because of undefined class

Reported by: anonymous Owned by: viboes
Milestone: Boost 1.52.0 Component: thread
Version: Boost 1.50.0 Severity: Problem
Keywords: Cc: viboes

Description

f:\dev\adoxx512_boost\adoxx\include\stlport\stl/type_traits.h(249) : error C2139: 'boost::detail::future_waiter::registered_waiter' : an undefined class is no t allowed as an argument to compiler intrinsic type trait 'has_trivial_constructor'

f:\dev\adoxx512_boost\adoxx\include\boost/thread/future.hpp(395) : see declaration of 'boost::detail::future_waiter::registered_waiter' f:\dev\adoxx512_boost\adoxx\include\stlport\stl/_vector.h(137) : see reference to class template instantiation 'stlpd_std::type_traits<_Tp>' being c

ompiled

with [

_Tp=boost::detail::future_waiter::registered_waiter

] f:\dev\adoxx512_boost\adoxx\include\stlport\stl/debug/_iterator.h(381) : see reference to class template instantiation 'stlpd_std::priv::_NonDbg_vecto

r<_Tp,_Alloc>' being compiled

with [

_Tp=boost::detail::future_waiter::registered_waiter, _Alloc=stlpd_std::allocator<boost::detail::future_waiter::registered_waiter>

] f:\dev\adoxx512_boost\adoxx\include\stlport\stl/debug/_vector.h(106) : see reference to class template instantiation 'stlpd_std::priv::construct_che

cker<_Container>' being compiled

with [

_Container=stlpd_std::priv::_NonDbg_vector<boost::detail::future_waiter::registered_waiter,stlpd_std::allocator<boost::detail::future_waiter::regi

stered_waiter>>

] f:\dev\adoxx512_boost\adoxx\include\boost/thread/future.hpp(396) : see reference to class template instantiation 'stlpd_std::vector<_Tp>' being compil

ed

with [

_Tp=boost::detail::future_waiter::registered_waiter

]

f:\dev\adoxx512_boost\adoxx\include\stlport\stl/type_traits.h(250) : error C2139: 'boost::detail::future_waiter::registered_waiter' : an undefined class is no t allowed as an argument to compiler intrinsic type trait 'has_trivial_copy'

f:\dev\adoxx512_boost\adoxx\include\boost/thread/future.hpp(395) : see declaration of 'boost::detail::future_waiter::registered_waiter'

f:\dev\adoxx512_boost\adoxx\include\stlport\stl/type_traits.h(251) : error C2139: 'boost::detail::future_waiter::registered_waiter' : an undefined class is no t allowed as an argument to compiler intrinsic type trait 'has_trivial_assign'

f:\dev\adoxx512_boost\adoxx\include\boost/thread/future.hpp(395) : see declaration of 'boost::detail::future_waiter::registered_waiter'

f:\dev\adoxx512_boost\adoxx\include\stlport\stl/type_traits.h(252) : error C2139: 'boost::detail::future_waiter::registered_waiter' : an undefined class is no t allowed as an argument to compiler intrinsic type trait 'has_trivial_destructor'

f:\dev\adoxx512_boost\adoxx\include\boost/thread/future.hpp(395) : see declaration of 'boost::detail::future_waiter::registered_waiter'

f:\dev\adoxx512_boost\adoxx\include\stlport\stl/type_traits.h(253) : error C2139: 'boost::detail::future_waiter::registered_waiter' : an undefined class is no t allowed as an argument to compiler intrinsic type trait 'is_pod'

f:\dev\adoxx512_boost\adoxx\include\boost/thread/future.hpp(395) : see declaration of 'boost::detail::future_waiter::registered_waiter'

workaround

class future_waiter {

struct registered_waiter;

typedef std::vector<registered_waiter>::size_type count_type;

typedef std::size_t count_type;

struct registered_waiter {

boost::shared_ptr<detail::future_object_base> future; detail::future_object_base::waiter_list::iterator wait_iterator; count_type index;

registered_waiter(boost::shared_ptr<detail::future_object_base> const& future_,

detail::future_object_base::waiter_list::iterator wait_iterator_, count_type index_):

future(future_),wait_iterator(wait_iterator_),index(index_)

{}

};

BOOST_MPL_ASSERT((boost::is_same<std::vector<registered_waiter>::size_type,std::size_t>));

Attachments

Change History

comment:1 Changed 2 years ago by viboes

  • Cc viboes added
  • Owner changed from anthonyw to viboes
  • Status changed from new to assigned

The proposed workaround corresponds to the existing code.

Could you tell us if the version 1.49 has yet the error?

comment:2 Changed 2 years ago by anonymous

  • Type changed from Bugs to Support Requests

Moved to support request until resolution clarified.

comment:3 Changed 2 years ago by viboes

  • Status changed from assigned to closed
  • Resolution set to worksforme
  • Milestone To Be Determined deleted

Closed as no answer received. Please reopen it once you have checked it on 1.49 (trunk).

comment:4 Changed 21 months ago by s.seifried@…

  • Status changed from closed to reopened
  • Version changed from Boost 1.46.0 to Boost 1.50.0
  • Resolution worksforme deleted

Still the same problem in 1.50.0. Changing the type trait "typedef std::vector<registered_waiter>::size_type count_type;" to the specific type "typedef std::size_t count_type;" fixed the problem as a quick workaround.

Environment is still the same, stlport 5.1.5 and msvc 8.1.

comment:5 Changed 21 months ago by viboes

Could you add the error relative to the fact the stlport 5.1.5 doesn't defines std::vector<T>::size_type?

Are there any compiler flags that can be tested to check for stlport 5.1.5?

comment:6 Changed 21 months ago by s.seifried@…

Just double checked, but stlport 5.1.5 does define size_type, and it is a public typedef to size_t. So this is fine from my point of view.

boost 1.50.0 was compiled without any additional compiler flags. If you want to try it out yourself, just grab a copy from stlport 5.1.5 from sourceforge and add it to the appropriate place in user config jam.

comment:7 Changed 20 months ago by viboes

I think I've understood what is happening. I will replace

struct registered_waiter;
typedef std::vector<registered_waiter>::size_type count_type;

by

struct registered_waiter;
typedef std::vector<int>::size_type count_type;

As the type std::vector<T>::size_type should not depend on T.

comment:8 Changed 20 months ago by viboes

  • Type changed from Support Requests to Bugs
  • Milestone set to Boost 1.52.0

comment:9 Changed 20 months ago by viboes

Committed in trunk revision 80053.

comment:10 Changed 20 months ago by viboes

  • Status changed from reopened to closed
  • Resolution set to fixed

Merged from trunk [80450].

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.