[C++-sig] Regression in Boost.Python v1.33

Niall Douglas s_sourceforge at nedprod.com
Fri Sep 30 22:45:50 CEST 2005


On 30 Sep 2005 at 7:49, David Abrahams wrote:

> No, all the tests passed for vc7.1 upon release of 1.33.0, so it's
> surprising to see a problem here.  Do you have any idea what T is in
> this case?  A full instantiation backtrace might help.

Here's the testcase:

#include "boost/python.hpp"

using namespace boost::python;

typedef void *FXID;

class FXWindow
{
public:
	void attach(FXID w) { }
};

int main(void)
{
    class_<FXWindow>("FXWindow")
        .def("attach", &FXWindow::attach);
	return 0;
}

This compiles on v1.32 but not v1.33. Here's the compiler error:

Compiling...
main.cpp
d:\Tornado\Tn\TClient\boost\boost\python\converter\registered.hpp(88) 
: error C2784: 'const boost::python::converter::registration 
&boost::python::converter::detail::registry_lookup(T &(__cdecl 
*)(void))' : could not deduce template argument for 'T1 &(__cdecl 
*)(void)' from 'volatile const boost::add_reference<T>::type (__cdecl 
*)(void)'
        with
        [
            T=volatile const 
boost::add_cv<boost::remove_pointer<boost::remove_cv<boost::mpl::v_ite
r<boost::mpl::vector3<void,boost::mpl::if_<boost::is_convertible<boost
::python::objects::class_metadata<FXWindow,boost::python::detail::not_
specified,boost::python::detail::not_specified,boost::python::detail::
not_specified>::held_type *,FXWindow *>,FXWindow,FXWindow>::type 
&,FXID>::type,2>::type >::type>::type>::type
        ]
        
d:\Tornado\Tn\TClient\boost\boost\python\converter\registered.hpp(81) 
: see declaration of 
'boost::python::converter::detail::registry_lookup'
        d:\Program Files\Microsoft Visual Studio .NET 
2003\Vc7\include\utility(32) : while compiling class-template static 
data member 'const boost::python::converter::registration 
&boost::python::converter::detail::registered_base<T>::converters'
        with
        [
            T=volatile const boost::add_reference<volatile const 
boost::add_cv<boost::remove_pointer<boost::remove_cv<boost::mpl::v_ite
r<boost::mpl::vector3<void,boost::mpl::if_<boost::is_convertible<boost
::python::objects::class_metadata<FXWindow,boost::python::detail::not_
specified,boost::python::detail::not_specified,boost::python::detail::
not_specified>::held_type *,FXWindow *>,FXWindow,FXWindow>::type 
&,FXID>::type,2>::type >::type>::type>::type>::type
        ]
        
d:\Tornado\Tn\TClient\boost\boost\python\converter\registered.hpp(41) 
: see reference to class template instantiation 
'boost::python::converter::detail::registered_base<T>' being compiled
        with
        [
            T=volatile const boost::add_reference<volatile const 
boost::add_cv<boost::remove_pointer<boost::remove_cv<boost::mpl::v_ite
r<boost::mpl::vector3<void,boost::mpl::if_<boost::is_convertible<boost
::python::objects::class_metadata<FXWindow,boost::python::detail::not_
specified,boost::python::detail::not_specified,boost::python::detail::
not_specified>::held_type *,FXWindow *>,FXWindow,FXWindow>::type 
&,FXID>::type,2>::type >::type>::type>::type>::type
        ]
        
d:\Tornado\Tn\TClient\boost\boost\python\converter\registered_pointee.
hpp(27) : see reference to class template instantiation 
'boost::python::converter::registered<T>' being compiled
        with
        [
            
T=boost::remove_pointer<boost::remove_cv<boost::mpl::v_iter<boost::mpl
::vector3<void,boost::mpl::if_<boost::is_convertible<boost::python::ob
jects::class_metadata<FXWindow,boost::python::detail::not_specified,bo
ost::python::detail::not_sp
ecified,boost::python::detail::not_specified>::held_type *,FXWindow 
*>,FXWindow,FXWindow>::type &,FXID>::type,2>::type >::type>::type
        ]
        
d:\Tornado\Tn\TClient\boost\boost\python\converter\arg_from_python.hpp
(269) : see reference to class template instantiation 
'boost::python::converter::registered_pointee<T>' being compiled
        with
        [
            
T=boost::remove_cv<boost::mpl::v_iter<boost::mpl::vector3<void,boost::
mpl::if_<boost::is_convertible<boost::python::objects::class_metadata<
FXWindow,boost::python::detail::not_specified,boost::python::detail::n
ot_specified,boost::python::detail::not_specified>::held_type 
*,FXWindow *>,FXWindow,FXWindow>::type &,FXID>::type,2>::type >::type 

        ]
        d:\Program Files\Microsoft Visual Studio .NET 
2003\Vc7\include\utility(32) : while compiling class-template member 
function 
'boost::python::converter::pointer_arg_from_python<T>::pointer_arg_fro
m_python(PyObject *)'
        with
        [
            
T=boost::remove_cv<boost::mpl::v_iter<boost::mpl::vector3<void,boost::
mpl::if_<boost::is_convertible<boost::python::objects::class_metadata<
FXWindow,boost::python::detail::not_specified,boost::python::detail::n
ot_specified,boost::python::detail::not_specified>::held_type 
*,FXWindow *>,FXWindow,FXWindow>::type &,FXID>::type,2>::type >::type 

        ]
        
d:\Tornado\Tn\TClient\boost\boost\detail\compressed_pair.hpp(200) : 
while compiling class-template member function 
'boost::python::arg_from_python<T>::arg_from_python(PyObject *)'
        with
        [
            
T=boost::mpl::v_iter<boost::mpl::vector3<void,boost::mpl::if_<boost::i
s_convertible<boost::python::objects::class_metadata<FXWindow,boost::p
ython::detail::not_specified,boost::python::detail::not_specified,boos
t::python::detail::not_specified>::held_type *,FXWindow 
*>,FXWindow,FXWindow>::type &,FXID>::type,2>::type
        ]
        
d:\Tornado\Tn\TClient\boost\boost\preprocessor\iteration\detail\local.
hpp(37) : see reference to class template instantiation 
'boost::python::arg_from_python<T>' being compiled
        with
        [
            
T=boost::mpl::v_iter<boost::mpl::vector3<void,boost::mpl::if_<boost::i
s_convertible<boost::python::objects::class_metadata<FXWindow,boost::p
ython::detail::not_specified,boost::python::detail::not_specified,boos
t::python::detail::not_specified>::held_type *,FXWindow 
*>,FXWindow,FXWindow>::type &,FXID>::type,2>::type
        ]
        
d:\Tornado\Tn\TClient\boost\boost\python\detail\caller.hpp(176) : 
while compiling class-template member function 'PyObject 
*boost::python::detail::caller_arity<2>::impl<F,Policies,Sig>::operato
r ()(PyObject *,PyObject *)'
        with
        [
            F=void (__thiscall FXWindow::* )(FXID),
            
Policies=boost::python::detail::tuple_extract_impl<false>::apply<boost
::python::detail::def_helper<const char 
*>::all_t,boost::mpl::lambda<boost::mpl::and_<boost::mpl::not_<boost::
is_same<const boost::python::detail::not_specified 
&,boost::mpl::_1>>,boost::detail::indirect_traits::is_reference_to_cla
ss<boost::mpl::_1>,boost::mpl::not_<boost::python::detail::is_referenc
e_to_keywords<boost::mpl::_1>>>>::type>::result_type,
            
Sig=boost::mpl::vector3<void,boost::mpl::if_<boost::is_convertible<boo
st::python::objects::class_metadata<FXWindow,boost::python::detail::no
t_specified,boost::python::detail::not_specified,boost::python::detail
::not_specified>::held_type *,FXWindow *>,FXWindow,FXWindow>::type 
&,FXID>
        ]
        
d:\Tornado\Tn\TClient\boost\boost\python\detail\caller.hpp(145) : see 
reference to class template instantiation 
'boost::python::detail::caller_arity<2>::impl<F,Policies,Sig>' being 
compiled
        with
        [
            F=void (__thiscall FXWindow::* )(FXID),
            
Policies=boost::python::detail::tuple_extract_impl<false>::apply<boost
::python::detail::def_helper<const char 
*>::all_t,boost::mpl::lambda<boost::mpl::and_<boost::mpl::not_<boost::
is_same<const boost::python::detail::not_specified 
&,boost::mpl::_1>>,boost::detail::indirect_traits::is_reference_to_cla
ss<boost::mpl::_1>,boost::mpl::not_<boost::python::detail::is_referenc
e_to_keywords<boost::mpl::_1>>>>::type>::result_type,
            
Sig=boost::mpl::vector3<void,boost::mpl::if_<boost::is_convertible<boo
st::python::objects::class_metadata<FXWindow,boost::python::detail::no
t_specified,boost::python::detail::not_specified,boost::python::detail
::not_specified>::held_type *,FXWindow *>,FXWindow,FXWindow>::type 
&,FXID>
        ]
        
d:\Tornado\Tn\TClient\boost\boost\python\make_function.hpp(61) : see 
reference to class template instantiation 
'boost::python::detail::caller<F,CallPolicies,Sig>' being compiled
        with
        [
            F=void (__thiscall FXWindow::* )(FXID),
            
CallPolicies=boost::python::detail::tuple_extract_impl<false>::apply<b
oost::python::detail::def_helper<const char 
*>::all_t,boost::mpl::lambda<boost::mpl::and_<boost::mpl::not_<boost::
is_same<const boost::python::detail::not_specified 
&,boost::mpl::_1>>,boost::detail::indirect_traits::is_reference_to_cla
ss<boost::mpl::_1>,boost::mpl::not_<boost::python::detail::is_referenc
e_to_keywords<boost::mpl::_1>>>>::type>::result_type,
            
Sig=boost::mpl::vector3<void,boost::mpl::if_<boost::is_convertible<boo
st::python::objects::class_metadata<FXWindow,boost::python::detail::no
t_specified,boost::python::detail::not_specified,boost::python::detail
::not_specified>::held_type *,FXWindow *>,FXWindow,FXWindow>::type 
&,FXID>
        ]
        
d:\Tornado\Tn\TClient\boost\boost\python\make_function.hpp(146) : see 
reference to function template instantiation 
'boost::python::api::object 
boost::python::detail::make_function_aux<F,CallPolicies,Signature,boos
t::mpl::int_<N>>(F,const CallPolicies &,const Sig &,const 
boost::python::detail::keyword_range &,NumKeywords)' being compiled
        with
        [
            F=void (__thiscall FXWindow::* )(FXID),
            
CallPolicies=boost::python::detail::tuple_extract_impl<false>::apply<b
oost::python::detail::def_helper<const char 
*>::all_t,boost::mpl::lambda<boost::mpl::and_<boost::mpl::not_<boost::
is_same<const boost::python::detail::not_specified 
&,boost::mpl::_1>>,boost::detail::indirect_traits::is_reference_to_cla
ss<boost::mpl::_1>,boost::mpl::not_<boost::python::detail::is_referenc
e_to_keywords<boost::mpl::_1>>>>::type>::result_type,
            
Signature=boost::mpl::vector3<void,boost::mpl::if_<boost::is_convertib
le<boost::python::objects::class_metadata<FXWindow,boost::python::deta
il::not_specified,boost::python::detail::not_specified,boost::python::
detail::not_specified>::held_type *,FXWindow 
*>,FXWindow,FXWindow>::type &,FXID>,
            N=0,
            
Sig=boost::mpl::vector3<void,boost::mpl::if_<boost::is_convertible<boo
st::python::objects::class_metadata<FXWindow,boost::python::detail::no
t_specified,boost::python::detail::not_specified,boost::python::detail
::not_specified>::held_type *,FXWindow *>,FXWindow,FXWindow>::type 
&,FXID>,
            NumKeywords=boost::mpl::int_<0>
        ]
        d:\Tornado\Tn\TClient\boost\boost\python\class.hpp(544) : see 
reference to function template instantiation 
'boost::python::api::object 
boost::python::make_function<Fn,boost::python::detail::tuple_extract_i
mpl<false>::apply<Tuple,Predicate>::result_type,boost::python::detail:
:tuple_extract_impl<false>::apply<Tuple,boost::mpl::protect<T>>::resul
t_type,boost::mpl::vector3<T0,T1,T2>>(F,const CallPolicies &,const 
Keywords &,const Signature &)' being compiled
        with
        [
            Fn=void (__
thiscall FXWindow::* )(FXID),
            Tuple=boost::python::detail::def_helper<const char 
*>::all_t,
            
Predicate=boost::mpl::lambda<boost::mpl::and_<boost::mpl::not_<boost::
is_same<const boost::python::detail::not_specified 
&,boost::mpl::_1>>,boost::detail::indirect_traits::is_reference_to_cla
ss<boost::mpl::_1>,boost::mpl::not_<boost::python::detail::is_referenc
e_to_keywords<boost::mpl::_1>>>>::type,
            
T=boost::mpl::aux::le_result1<boost::mpl::lambda<boost::python::detail
::is_reference_to_keywords<boost::mpl::_1>>::is_le,boost::mpl::void_,b
oost::python::detail::is_reference_to_keywords,boost::mpl::lambda<boos
t::python::detail::is_reference_to_keywords<boost::mpl::_1>>::l1>::res
ult_,
            T0=void,
            
T1=boost::mpl::if_<boost::is_convertible<boost::python::objects::class
_metadata<FXWindow,boost::python::detail::not_specified,boost::python:
:detail::not_specified,boost::python::detail::not_specified>::held_typ
e *,FXWindow *>,FXWindow,FXWindow>::type &,
            T2=FXID,
            F=void (__thiscall FXWindow::* )(FXID),
            
CallPolicies=boost::python::detail::tuple_extract_impl<false>::apply<b
oost::python::detail::def_helper<const char 
*>::all_t,boost::mpl::lambda<boost::mpl::and_<boost::mpl::not_<boost::
is_same<const boost::python::detail::not_specified 
&,boost::mpl::_1>>,boost::detail::indirect_traits::is_reference_to_cla
ss<boost::mpl::_1>,boost::mpl::not_<boost::python::detail::is_referenc
e_to_keywords<boost::mpl::_1>>>>::type>::result_type,
            
Keywords=boost::python::detail::tuple_extract_impl<false>::apply<boost
::python::detail::def_helper<const char 
*>::all_t,boost::mpl::lambda<boost::python::detail::is_reference_to_ke
ywords<boost::mpl::_1>>::type>::result_type,
            
Signature=boost::mpl::vector3<void,boost::mpl::if_<boost::is_convertib
le<boost::python::objects::class_metadata<FXWindow,boost::python::deta
il::not_specified,boost::python::detail::not_specified,boost::python::
detail::not_specified>::held_type *,FXWindow 
*>,FXWindow,FXWindow>::type 
&,FXID>
        ]
        d:\Tornado\Tn\TClient\boost\boost\python\class.hpp(237) : see 
reference to function template instantiation 'void 
boost::python::class_<W>::def_impl<W,F,boost::python::detail::def_help
er<T1>>(T *,const char *,Fn,const Helper &,...)' being compiled
        with
        [
            W=FXWindow,
            F=void (__thiscall FXWindow::* )(FXID),
            T1=const char *,
            T=FXWindow,
            Fn=void (__thiscall FXWindow::* )(FXID),
            Helper=boost::python::detail::def_helper<const char *>
        ]
        d:\Tornado\Tn\TClient\BoostBug\main.cpp(15) : see reference 
to function template instantiation 'boost::python::class_<W>::self 
&boost::python::class_<W>::def<void(__thiscall FXWindow::* 
)(FXID)>(const char *,F)' being compiled
        with
        [
            W=FXWindow,
            F=void (__thiscall FXWindow::* )(FXID)
        ]

Cheers,
Niall






More information about the Cplusplus-sig mailing list