Opened 10 years ago

Closed 10 years ago

#7914 closed Bugs (fixed)

std::tr1::tuple fails to compile in C++11 when defining BOOST_FUSION_DONT_USE_PREPROCESSED_FILES

Reported by: ipapadop@… Owned by: Joel de Guzman
Milestone: To Be Determined Component: fusion
Version: Boost 1.53.0 Severity: Problem
Keywords: Cc:

Description

Test code:

#include <boost/tr1/tuple.hpp>
#include <boost/tr1/functional.hpp>

int a, b;

std::tr1::tuple<int&, int&> get()
{
  return std::tr1::tuple<int&, int&>(std::tr1::ref(a), std::tr1::ref(b));
}

int main()
{
  std::tr1::tuple<int&, int&> t = get();
  return 0;
} 

It fails to compile in C++11 mode and when BOOST_FUSION_DONT_USE_PREPROCESSED_FILES is defined. Same code compiles fine with Boost 1.48 and 1.49

$ g++ --std=c++11 -DBOOST_FUSION_DONT_USE_PREPROCESSED_FILES test.cc -I /usr/local/boost/boost_1_53_beta/include/
In file included from /usr/local/boost/boost_1_53_beta/include/boost/preprocessor/iteration/detail/iter/forward1.hpp:57:0,
                 from /usr/local/boost/boost_1_53_beta/include/boost/fusion/container/vector/vector10.hpp:87,
                 from /usr/local/boost/boost_1_53_beta/include/boost/fusion/container/vector/vector_fwd.hpp:14,
                 from /usr/local/boost/boost_1_53_beta/include/boost/fusion/container/vector/vector.hpp:10,
                 from /usr/local/boost/boost_1_53_beta/include/boost/fusion/tuple/tuple.hpp:11,
                 from /usr/local/boost/boost_1_53_beta/include/boost/fusion/tuple.hpp:10,
                 from /usr/local/boost/boost_1_53_beta/include/boost/fusion/include/tuple.hpp:10,
                 from /usr/local/boost/boost_1_53_beta/include/boost/tr1/tuple.hpp:58,
                 from test.cc:1:
/usr/local/boost/boost_1_53_beta/include/boost/fusion/container/vector/detail/vector_n.hpp: In instantiation of ‘struct boost::fusion::vector_data2<int&, int&>’:
/usr/local/boost/boost_1_53_beta/include/boost/fusion/container/vector/detail/vector_n.hpp:103:1:   required from ‘struct boost::fusion::vector2<int&, int&>’
/usr/local/boost/boost_1_53_beta/include/boost/fusion/container/vector/vector.hpp:92:42:   required from ‘struct boost::fusion::vector<int&, int&, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_>’
/usr/local/boost/boost_1_53_beta/include/boost/fusion/tuple/tuple.hpp:44:12:   required from ‘struct boost::fusion::tuple<int&, int&>’
test.cc:6:33:   required from here
/usr/local/boost/boost_1_53_beta/include/boost/fusion/container/vector/detail/vector_n.hpp:57:1: error: ‘boost::fusion::vector_data2<T0, T1>::vector_data2(typename boost::fusion::detail::call_param<Car>::type, typename boost::fusion::detail::call_param<Cdr>::type) [with T0 = int&; T1 = int&; typename boost::fusion::detail::call_param<Car>::type = int&; typename boost::fusion::detail::call_param<Cdr>::type = int&]’ cannot be overloaded
/usr/local/boost/boost_1_53_beta/include/boost/fusion/container/vector/detail/vector_n.hpp:53:1: error: with ‘boost::fusion::vector_data2<T0, T1>::vector_data2(T0&&, T1&&) [with T0 = int&; T1 = int&]’
/usr/local/boost/boost_1_53_beta/include/boost/fusion/container/vector/detail/vector_n.hpp: In instantiation of ‘struct boost::fusion::vector2<int&, int&>’:
/usr/local/boost/boost_1_53_beta/include/boost/fusion/container/vector/vector.hpp:92:42:   required from ‘struct boost::fusion::vector<int&, int&, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_>’
/usr/local/boost/boost_1_53_beta/include/boost/fusion/tuple/tuple.hpp:44:12:   required from ‘struct boost::fusion::tuple<int&, int&>’
test.cc:6:33:   required from here
/usr/local/boost/boost_1_53_beta/include/boost/fusion/container/vector/detail/vector_n.hpp:130:1: error: ‘boost::fusion::vector2<T0, T1>::vector2(T0&&, T1&&) [with T0 = int&; T1 = int&]’ cannot be overloaded
/usr/local/boost/boost_1_53_beta/include/boost/fusion/container/vector/detail/vector_n.hpp:121:1: error: with ‘boost::fusion::vector2<T0, T1>::vector2(typename boost::fusion::detail::call_param<Car>::type, typename boost::fusion::detail::call_param<Cdr>::type) [with T0 = int&; T1 = int&; typename boost::fusion::detail::call_param<Car>::type = int&; typename boost::fusion::detail::call_param<Cdr>::type = int&]’
In file included from /usr/local/boost/boost_1_53_beta/include/boost/preprocessor/iteration/detail/iter/forward1.hpp:52:0,
                 from /usr/local/boost/boost_1_53_beta/include/boost/fusion/container/vector/detail/vector_forward_ctor.hpp:20,
                 from /usr/local/boost/boost_1_53_beta/include/boost/fusion/container/vector/vector.hpp:125,
                 from /usr/local/boost/boost_1_53_beta/include/boost/fusion/tuple/tuple.hpp:11,
                 from /usr/local/boost/boost_1_53_beta/include/boost/fusion/tuple.hpp:10,
                 from /usr/local/boost/boost_1_53_beta/include/boost/fusion/include/tuple.hpp:10,
                 from /usr/local/boost/boost_1_53_beta/include/boost/tr1/tuple.hpp:58,
                 from test.cc:1:
/usr/local/boost/boost_1_53_beta/include/boost/fusion/container/vector/vector.hpp: In instantiation of ‘struct boost::fusion::vector<int&, int&, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_>’:
/usr/local/boost/boost_1_53_beta/include/boost/fusion/tuple/tuple.hpp:44:12:   required from ‘struct boost::fusion::tuple<int&, int&>’
test.cc:6:33:   required from here
/usr/local/boost/boost_1_53_beta/include/boost/fusion/container/vector/detail/vector_forward_ctor.hpp:44:5: error: ‘boost::fusion::vector<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>::vector(T0&&) [with T0 = int&; T1 = int&; T2 = boost::fusion::void_; T3 = boost::fusion::void_; T4 = boost::fusion::void_; T5 = boost::fusion::void_; T6 = boost::fusion::void_; T7 = boost::fusion::void_; T8 = boost::fusion::void_; T9 = boost::fusion::void_]’ cannot be overloaded
/usr/local/boost/boost_1_53_beta/include/boost/fusion/container/vector/detail/vector_forward_ctor.hpp:36:5: error: with ‘boost::fusion::vector<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>::vector(typename boost::fusion::detail::call_param<T0>::type) [with T0 = int&; T1 = int&; T2 = boost::fusion::void_; T3 = boost::fusion::void_; T4 = boost::fusion::void_; T5 = boost::fusion::void_; T6 = boost::fusion::void_; T7 = boost::fusion::void_; T8 = boost::fusion::void_; T9 = boost::fusion::void_; typename boost::fusion::detail::call_param<T0>::type = int&]’
In file included from /usr/local/boost/boost_1_53_beta/include/boost/preprocessor/iteration/detail/iter/forward1.hpp:57:0,
                 from /usr/local/boost/boost_1_53_beta/include/boost/fusion/container/vector/detail/vector_forward_ctor.hpp:20,
                 from /usr/local/boost/boost_1_53_beta/include/boost/fusion/container/vector/vector.hpp:125,
                 from /usr/local/boost/boost_1_53_beta/include/boost/fusion/tuple/tuple.hpp:11,
                 from /usr/local/boost/boost_1_53_beta/include/boost/fusion/tuple.hpp:10,
                 from /usr/local/boost/boost_1_53_beta/include/boost/fusion/include/tuple.hpp:10,
                 from /usr/local/boost/boost_1_53_beta/include/boost/tr1/tuple.hpp:58,
                 from test.cc:1:
/usr/local/boost/boost_1_53_beta/include/boost/fusion/container/vector/detail/vector_forward_ctor.hpp:44:5: error: ‘boost::fusion::vector<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>::vector(T0&&, T1&&) [with T0 = int&; T1 = int&; T2 = boost::fusion::void_; T3 = boost::fusion::void_; T4 = boost::fusion::void_; T5 = boost::fusion::void_; T6 = boost::fusion::void_; T7 = boost::fusion::void_; T8 = boost::fusion::void_; T9 = boost::fusion::void_]’ cannot be overloaded
/usr/local/boost/boost_1_53_beta/include/boost/fusion/container/vector/detail/vector_forward_ctor.hpp:36:5: error: with ‘boost::fusion::vector<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>::vector(typename boost::fusion::detail::call_param<T0>::type, typename boost::fusion::detail::call_param<T1>::type) [with T0 = int&; T1 = int&; T2 = boost::fusion::void_; T3 = boost::fusion::void_; T4 = boost::fusion::void_; T5 = boost::fusion::void_; T6 = boost::fusion::void_; T7 = boost::fusion::void_; T8 = boost::fusion::void_; T9 = boost::fusion::void_; typename boost::fusion::detail::call_param<T0>::type = int&; typename boost::fusion::detail::call_param<T1>::type = int&]’

Change History (2)

comment:1 by ipapadop@…, 10 years ago

Version: Boost 1.52.0Boost 1.53.0

comment:2 by Joel de Guzman, 10 years ago

Resolution: fixed
Status: newclosed

Fixed in trunk

Note: See TracTickets for help on using tickets.