Opened 8 years ago

Closed 8 years ago

#3339 closed Bugs (fixed)

intrusive containers vs. Sun CC

Reported by: Christopher Hite <c.hite@…> Owned by: Ion Gaztañaga
Milestone: Boost 1.40.0 Component: intrusive
Version: Boost 1.39.0 Severity: Problem
Keywords: Cc:


Intrusive doesn't not work at all with SunCC. The regression tests were turned off.

I'm not sure if it fixes everything, but I was able debug some of the meta-programming and find a discrepancy between gcc and Sun CC which causes normal usage to break.

template <class T> 
struct internal_base_hook_bool 
   template<bool Add> 
   struct two_or_three {one _[2 + Add];}; 
   template <class U> static one test(...); 
   template <class U> static 
      test (detail::bool_<U::boost_intrusive_tags::is_base_hook>* = 0); 
   static const std::size_t value = sizeof(test<T>(0)); 

On gcc it does what it's suppose to; value =

1 - iff T has no boost_intrusive_tags::is_base_hook
2 - iff T::boost_intrusive_tags::is_base_hook=false
3 - iff T::boost_intrusive_tags::is_base_hook=true

On Sun CC it's always 1. So this is a usage of SFINAE which doesn't seem to work on SunCC, but other examples do work just fine: class_has_move_assign here:[[BR]]  Note how they use a second test(int) function. This works fine on Sun CC!

So I would suggest changing this in the few places in intrusive where SFINAE is used. Perhaps intrusive will then work on the latest Sun CC (which supposedly supports (mostly) MPL). Do you have a Sun environment to run the regression tests?

Attachments (0)

Change History (7)

comment:1 Changed 8 years ago by Steven Watanabe

Can you

  1. Make a patch
  2. Run the regression tests.

To run the regression tests manually use

cd libs/intrisuve/test
bjam toolset=sun

comment:2 Changed 8 years ago by Christopher Hite <c.hite@…>

I did the fix I suggested and libs/intrisuve/test looks a little better ...failed updating 19 targets... went to: ...failed updating 16 targets... revision 55765

The reason all the other tests fail is that they test the class twice once with normal pointers and once with a test smart_pointer class which resembles interprocess::pointer. Issues with this test class seem to still break on Sun CC. I don't really care in my application. It would be nice if I could show the tests for the individual classes worked.

Could we merge my very small changes into the trunk?

Do I need to continue and fix the smart pointer test? Does anyone care?

comment:3 Changed 8 years ago by anonymous

Can you show us the patch?

comment:4 Changed 8 years ago by Christopher Hite <c.hite@…>

r55765 - sorry hadn't read Trac Links page.

comment:5 Changed 8 years ago by Ion Gaztañaga

The patch:

seems ok. Please commit, but it would nice if you could also fix other test cases.

comment:6 Changed 8 years ago by Christopher Hite <c.hite@…>

Sorry, I don't think I have privileges to touch the trunk. I only asked for a sandbox account.

r55775 - I was able to fix the test code! After removing explicit from smart_ptr's constructor everything works fine. All tests pass on my version of Sun CC.
CC: Sun C++ 5.9 SunOS_i386 Patch 124864-12 2009/04/21

I kind of think Sun CC is right to complain about this:

".../boost/intrusive/sgtree.hpp", line 390: Error: Formal argument header of type 
	in call to static 
	is being passed 

You are converting node* to node_ptr implicitly in that call. I can't figure out why gcc allows this. You'd think it'd be the second "template <class T> smart_ptr(T *ptr)", but commenting that doesn't keep gcc from compiling.

1) So please review this other tiny one line change and let me know it's all good.

2) Please do the merging or let me know if I can.

3) Someone needs to turn these tests back on for Sun 5.9. You may need to upgrade it from 2007/05/03 to something this year.

comment:7 Changed 8 years ago by Christopher Hite <c.hite@…>

Resolution: fixed
Status: newclosed

1-2: You can forget about. I merged the changes to trunk (r55784).

3: I'll ask the list about.

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain Ion Gaztañaga.
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.