Opened 11 years ago

Closed 11 years ago

#6175 closed Bugs (fixed)

Compile error with SunStudio

Reported by: anonymous Owned by: viboes
Milestone: Boost 1.49.0 Component: thread
Version: Boost 1.48.0 Severity: Showstopper
Keywords: Cc:

Description

Version of compiler: CC: Sun C++ 5.10 SunOS_sparc 2009/06/03

A compile error occurs with the above compiler when boost/thread.hpp is included:

"./boost/thread/future.hpp", line 422: Error:
boost::unique_lock<boost::mutex>::operator=(boost::unique_lock<boost::mutex>&)
is not accessible from
boost::detail::future_waiter::all_futures_lock::all_futures_lock(std::vector<boost::detail::future_waiter::registered_waiter>&).

There is a patch for this issue in the mailinglist: http://lists.boost.org/Archives/boost/2011/03/179261.php

But it is still not committed.

Change History (5)

comment:1 by viboes, 11 years ago

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

Please could you check if the following works in your configuration?

boost::move(locks[i]=boost::unique_lock<boost::mutex>(futures[i].future->mutex));

comment:2 by viboes, 11 years ago

Cc: viboes removed
Milestone: To Be DeterminedBoost 1.49.0

In order to state clearly that this is a workaround I will use instead

#if defined __DECCXX || defined __SUNPRO_CC
                        locks[i]=boost::unique_lock<boost::mutex>(futures[i].future->mutex).move();
#else
                        locks[i]=boost::unique_lock<boost::mutex>(futures[i].future->mutex);
#endif

Let me know if this works for you.

Committed in trunk revision 75788.

comment:3 by anonymous, 11 years ago

Yeah, it compiles with this workaround.

Is this a good workaround?

You could also change the visibility of unique_lock& operator=(unique_lock&) in boost/thread/locks.hpp to public.

I think the root of problem has something to do that the sun compiler does not support rvalue references. The define BOOST_NO_RVALUE_REFERENCES is set in boost/config/compiler/sunpro_cc.hpp.

comment:4 by viboes, 11 years ago

Please could you open another ticket for the visibility?

comment:5 by viboes, 11 years ago

Resolution: fixed
Status: assignedclosed

Committed in release at #76291

Note: See TracTickets for help on using tickets.