This code builds and runs under g++ 4.2.2. It fails under 4.3.1. Help?
Tim
#include
using boost::lambda::_1;
template<typename Tcallback>
void function(Tcallback callback)
{
(void)callback;
}
int main()
{
function(_1); // works
function(_1+0); // fails
return 0;
}
$ /usr/crosstool/v12/gcc-4.3.1-glibc-2.3.6-grte//i686-unknown-linux-gnu/bin/i686-unknown-linux-gnu-g++
-W -Wall -o broken broken.cc -I/usr/include
/usr/include/boost/lambda/detail/lambda_functors.hpp: In instantiation
of 'boost::lambda::lambda_functor
':
/usr/include/boost/lambda/detail/lambda_functor_base.hpp:164:
instantiated from
'boost::lambda::detail::deduce_argument_types_, boost::tuples::null_type>'
/usr/include/boost/lambda/detail/lambda_functor_base.hpp:170:
instantiated from
'boost::lambda::detail::deduce_argument_types_
, const int, boost::tuples::null_type, boost::tuples::null_type,
boost::tuples::null_type, boost::tuples::null_type,
boost::tuples::null_type, boost::tuples::null_type,
boost::tuples::null_type, boost::tuples::null_type>,
boost::tuples::null_type>'
/usr/include/boost/lambda/detail/lambda_functor_base.hpp:213:
instantiated from
'boost::lambda::detail::deduce_argument_types
, const int, boost::tuples::null_type, boost::tuples::null_type,
boost::tuples::null_type, boost::tuples::null_type,
boost::tuples::null_type, boost::tuples::null_type,
boost::tuples::null_type, boost::tuples::null_type>,
boost::tuples::null_type>'
/usr/include/boost/lambda/detail/operator_lambda_func_base.hpp:60:
instantiated from
'boost::lambda::detail::binary_rtboost::lambda::plus_action,
boost::tuples::tuple
, const int, boost::tuples::null_type, boost::tuples::null_type,
boost::tuples::null_type, boost::tuples::null_type,
boost::tuples::null_type, boost::tuples::null_type,
boost::tuples::null_type, boost::tuples::null_type>,
boost::tuples::null_type>'
/usr/include/boost/lambda/detail/operator_lambda_func_base.hpp:206:
instantiated from
'boost::lambda::lambda_functor_baseboost::lambda::plus_action,
boost::tuples::tuple
, const int, boost::tuples::null_type, boost::tuples::null_type,
boost::tuples::null_type, boost::tuples::null_type,
boost::tuples::null_type, boost::tuples::null_type,
boost::tuples::null_type, boost::tuples::null_type>
::sigboost::tuples::null_type'
/usr/include/boost/lambda/detail/lambda_functors.hpp:135:
instantiated from
'boost::lambda::lambda_functorboost::lambda::plus_action,
boost::tuples::tuple
, const int, boost::tuples::null_type, boost::tuples::null_type,
boost::tuples::null_type, boost::tuples::null_type,
boost::tuples::null_type, boost::tuples::null_type,
boost::tuples::null_type, boost::tuples::null_type> > >'
broken.cc:14: instantiated from here
/usr/include/boost/lambda/detail/lambda_functors.hpp:137: warning:
type qualifiers ignored on function return type