Modify

Opened 7 years ago

Closed 5 years ago

#5274 closed Bugs (fixed)

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 (0)

Change History (10)

comment:1 Changed 6 years ago by viboes

Cc: viboes added
Owner: changed from Anthony Williams to viboes
Status: newassigned

The proposed workaround corresponds to the existing code.

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

comment:2 Changed 6 years ago by anonymous

Type: BugsSupport Requests

Moved to support request until resolution clarified.

comment:3 Changed 6 years ago by viboes

Milestone: To Be Determined
Resolution: worksforme
Status: assignedclosed

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

comment:4 Changed 5 years ago by s.seifried@…

Resolution: worksforme
Status: closedreopened
Version: Boost 1.46.0Boost 1.50.0

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 5 years 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 5 years 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 5 years 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 5 years ago by viboes

Milestone: Boost 1.52.0
Type: Support RequestsBugs

comment:9 Changed 5 years ago by viboes

Committed in trunk revision 80053.

comment:10 Changed 5 years ago by viboes

Resolution: fixed
Status: reopenedclosed

Merged from trunk [80450].

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain viboes.
The resolution will be deleted.

Add Comment


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

 
Note: See TracTickets for help on using tickets.