Opened 12 years ago

Closed 12 years ago

#5097 closed Bugs (worksforme)

Boost Fusion fails to compile with transform or mpl headers included

Reported by: vivek@… Owned by: Joel de Guzman
Milestone: To Be Determined Component: fusion
Version: Boost 1.45.0 Severity: Showstopper
Keywords: Cc:

Description

Fusion fails to compile as soon as the transform.hpp or mpl.hpp headers are included.

//
// Compile command: g++ test.cpp
// Boost 1.45.0
// gcc -v produces:
//	Using built-in specs.
//	Target: i686-linux-gnu
//	Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.4.4-14ubuntu5' --with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.4 --enable-shared --enable-multiarch --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.4 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --enable-targets=all --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=i686-linux-gnu --host=i686-linux-gnu --target=i686-linux-gnu
//	Thread model: posix
//	gcc version 4.4.5 (Ubuntu/Linaro 4.4.4-14ubuntu5) 
//

// Including any of the following 3 headers, or any permutation causes the error
#include <boost/fusion/algorithm/transformation/transform.hpp>
#include <boost/fusion/include/transform.hpp>
#include <boost/fusion/include/mpl.hpp>

int main() {
	return 0;
}

Error message is the same regardless of the combination of headers:

In file included from /usr/local/include/boost/fusion/view/joint_view/joint_view.hpp:15,
                 from /usr/local/include/boost/fusion/algorithm/transformation/erase.hpp:13,
                 from /usr/local/include/boost/fusion/mpl/erase.hpp:12,
                 from /usr/local/include/boost/fusion/mpl.hpp:20,
                 from /usr/local/include/boost/fusion/include/mpl.hpp:11,
                 from test.cpp:15:
/usr/local/include/boost/fusion/view/joint_view/joint_view_iterator.hpp:28: error: redeclared with 4 template parameter(s)
/usr/local/include/boost/fusion/view/joint_view/detail/next_impl.hpp:19: note: previous declaration ‘template<class First, class Last, class Concat> struct boost::fusion::joint_view_iterator’ used 3 template parameter(s)
/usr/local/include/boost/fusion/view/joint_view/joint_view_iterator.hpp:29: error: wrong number of template arguments (4, should be 3)
/usr/local/include/boost/fusion/view/joint_view/detail/next_impl.hpp:19: error: provided for ‘template<class First, class Last, class Concat> struct boost::fusion::joint_view_iterator’
/usr/local/include/boost/fusion/view/joint_view/joint_view_iterator.hpp:29: error: template argument 1 is invalid

Attachments (1)

next_impl_vs.hpp (2.1 KB ) - added by vivek@… 12 years ago.
An old version of next_impl.hpp that seems to have been installed with boost 1.45.0

Download all attachments as: .zip

Change History (4)

comment:1 by Christopher Schmidt, 12 years ago

Your code compiles fine here (boost 1.45, gcc 4.5.1). What's interesting is that you got a declaration of joint_view_iterator in next_impl.hpp:19 with 3 template type parameters, whereas the 1.45's next_impl.hpp:19 implements a declaration with 4 template type parameters.

https://github.com/ryppl/boost-svn/blob/2c676182ae36bbb8a33ff3da0a7a0b7cd97f0eae/boost/fusion/view/joint_view/detail/next_impl.hpp

by vivek@…, 12 years ago

Attachment: next_impl_vs.hpp added

An old version of next_impl.hpp that seems to have been installed with boost 1.45.0

comment:2 by vivek@…, 12 years ago

I looked at my /usr/local/include/boost/fusion/view/joint_view/detail/next_impl.hpp file, and the joint_view_iterator template contains 3, not 4, arguments. Attached is that version of the file as next_impl_vs.hpp. I verified that I had indeed installed 1.45.0 by looking at boost/version.hpp.

Anyway, a complete boost re-install from a fresh archive from sourceforge did the trick. Might there have been a defective 1.45.0 archive up there in the past?

comment:3 by vivek@…, 12 years ago

Resolution: worksforme
Status: newclosed
Note: See TracTickets for help on using tickets.