Opened 11 years ago

Closed 10 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@…> 11 years ago.
compile fix for g++-4.3
zip_view.cc (51 bytes) - added by bcs26@… 11 years ago.
simple failing test case

Download all attachments as: .zip

Change History (6)

Changed 11 years ago by tim blechmann <tim@…>

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

compile fix for g++-4.3

comment:1 Changed 11 years ago by bcs26@…

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

Changed 11 years ago by bcs26@…

Attachment: zip_view.cc added

simple failing test case

comment:2 Changed 10 years ago by Aleksey Gurtovoy

Status: newassigned

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

Thanks for the patch!

comment:3 Changed 10 years ago by Steven Robbins <smr@…>

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

comment:4 Changed 10 years ago by Aleksey Gurtovoy

Resolution: fixed
Status: assignedclosed

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

Note: See TracTickets for help on using tickets.