Opened 15 years ago

Closed 14 years ago

#1528 closed Bugs (fixed)

g++ 4.3.0 reports error because of redeclaration of next

Reported by: jensseidel@… Owned by: Aleksey Gurtovoy
Milestone: Boost 1.36.0 Component: mpl
Version: Boost Development Trunk Severity: Problem
Keywords: Cc:

Description

Compiling parts of Fusion shows the following bug in MPL with a recent g++ 4.3 snapshot:

In file included from /home/jens/trunk/boost/fusion/view/zip_view/detail/equal_to_impl.hpp:16, from /home/jens/trunk/boost/fusion/view/zip_view/zip_view_iterator.hpp:19, from /home/jens/trunk/boost/fusion/view/zip_view.hpp:12, from /home/jens/trunk/boost/fusion/include/zip_view.hpp:10, from /tmp/testDTdYXq.cpp:1: /home/jens/trunk/boost/mpl/zip_view.hpp:42: error: declaration of 'typedef struct boost::mpl::zip_iterator<typename boost::mpl::transform1<IteratorSeq, boost::mpl::next<mpl_::arg<1> >, mpl_::na>::type> boost::mpl::zip_iterator<IteratorSeq>::next' /home/jens/trunk/boost/mpl/next_prior.hpp:30: error: changes meaning of 'next' from 'struct boost::mpl::next<mpl_::arg<1> >' /home/jens/trunk/boost/mpl/zip_view.hpp:56: error: declaration of 'typedef struct boost::mpl::zip_iterator<typename boost::mpl::transform1<Sequences, boost::mpl::begin<mpl_::arg<1> >, mpl_::na>::type> boost::mpl::zip_view<Sequences>::begin' /home/jens/trunk/boost/mpl/begin_end.hpp:32: error: changes meaning of 'begin' from 'struct boost::mpl::begin<mpl_::arg<1> >' /home/jens/trunk/boost/mpl/zip_view.hpp:57: error: declaration of 'typedef struct boost::mpl::zip_iterator<typename boost::mpl::transform1<Sequences, boost::mpl::end<mpl_::arg<1> >, mpl_::na>::type> boost::mpl::zip_view<Sequences>::end' /home/jens/trunk/boost/mpl/begin_end.hpp:44: error: changes meaning of 'end' from 'struct boost::mpl::end<mpl_::arg<1> >'

I think the problem is that in boost::mpl::zip_iterator boost::mpl::next is visible and does not allow to define a new next (even if relative to zip_iterator).

See http://en.opensuse.org/GCC_4.3_Transition and http://gcc.gnu.org/ml/gcc/2007-09/msg00480.html for more details.

Just renaming one of the "next" fixes this problem but introduces of course many more.

PS: Please fix the typo "shorcuts" in one of the MPL header file.

Attachments (2)

0001-mpl-g-4.3-fix.patch (1.1 KB ) - added by tim blechmann <tim@…> 15 years ago.
compile fix for g++-4.3
zip_view.cc (51 bytes ) - added by bcs26@… 14 years ago.
simple failing test case

Download all attachments as: .zip

Change History (6)

by tim blechmann <tim@…>, 15 years ago

Attachment: 0001-mpl-g-4.3-fix.patch added

compile fix for g++-4.3

comment:1 by bcs26@…, 14 years ago

I can confirm that Tim's attached changes fix this issue for me under gcc-4.3 and boost-1.35.

by bcs26@…, 14 years ago

Attachment: zip_view.cc added

simple failing test case

comment:2 by Aleksey Gurtovoy, 14 years ago

Status: newassigned

Fixed in the trunk (changeset:46620), to be integrated in the release branch.

Thanks for the patch!

comment:3 by Steven Robbins <smr@…>, 14 years ago

Since the patch is applied, I believe this ticket should be closed.

comment:4 by Aleksey Gurtovoy, 14 years ago

Resolution: fixed
Status: assignedclosed

Merged into release branch as a part of the changeset:47650

Note: See TracTickets for help on using tickets.