Hi Jacob,

El 09/01/2012 1:01, Jacob Metcalfe escribió:

I’m having issues compiling some multi_index_container code after upgrading from
gcc 4.3.4 to gcc 4.6.1 and wondering if anyone can shed some light. Perhaps this
should be directed to gcc, but I have not been able to reduce this to not include multi_index.
The contrived code below is the furthest I have been able to reduce the problem so far:

[...]

The failures from gcc 4.6.1 are:

boost/multi_index/detail/index_base.hpp: In function 'void foo() [with int T = 5]':

boost/multi_index/detail/index_base.hpp:49:47: error: 'typedef struct boost::multi_index::detail::index_node_base<Data, std::allocator<Data> > boost::multi_index::detail::index_base<Data, boost::multi_index::indexed_by<boost::multi_index::ordered_non_unique<boost::multi_index::composite_key<Data, boost::multi_index::member<Data, double, &Data::_d> > > >, std::allocator<Data> >::node_type' is protected

tstmi.cpp:24:10: error: within this context

This code appears to compile fine under 4.3.4 and would compile with 4.6.1 if the
useless template at line 18 was removed.


This seems to me to be a regression of some sort with GCC. Googling around I've
found that the issue seems to have been already reported in GCC Bugzilla:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51556

As it happens, older versions of GCC had a problem with some protected classes
in Boost.MultiIndex, as reported (and fixed) at:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=9810

So as to provide a workaround, boost/multi_index/detail/access_specifier.hpp
defines such protected classes as being publicly derived instead for faulty
compilers, please take a look at the source code, particularly lines 45-53.

Could you please do the following?

1. Check whether the testcase for GCC bug 9810 serves also as a testcase
for 51556 (which hopefully can help fix the regression.)
2. Determine whether locally tweaking access_specifier.hpp so that
GCC 4.6.1 gets public derivation rather than protected solves the problem.
3. If #2 works, provide me with info on which versions of GCC must be added
to the workaround in access_specifier.hpp (I understand it'll be more than
just 4.6.1, at least 4.6.2 is mentioned in GCC bug 51556.)

Thank you,

Joaquín M López Muñoz
Telefónica Digital


Este mensaje se dirige exclusivamente a su destinatario. Puede consultar nuestra política de envío y recepción de correo electrónico en el enlace situado más abajo.
This message is intended exclusively for its addressee. We only send and receive email on the basis of the terms set out at.
http://www.tid.es/ES/PAGINAS/disclaimer.aspx