[C++-sig] Signatures/docstrings bug

Nikolay Mladenov nickm at sitius.com
Wed Sep 12 23:30:27 CEST 2007


Should be fixed in the repository.

Neal Becker wrote:
> 
> New python function sig code breaks this test case (gcc-4.1.2):
> 
> #include <boost/shared_ptr.hpp>
> #include <boost/python/module.hpp>
> #include <boost/python/def.hpp>
> #include <boost/python/class.hpp>
> #include <boost/python/init.hpp>
> 
> using namespace boost::python;
> 
> struct base {};
> struct concrete : public base {};
> 
> struct Test {
>   Test (boost::shared_ptr<base> _x) : x (_x) {}
>   boost::shared_ptr<base> x;
> };
> 
> BOOST_PYTHON_MODULE(test1) {
>   class_<base, boost::noncopyable> ("base", "abstract", no_init);
>   class_<concrete, bases<base> > ("concrete", "concrete");
>   class_<Test> ("Test", init<boost::shared_ptr<base> >())
>     .def_readonly ("x", &Test::x, "x") <<<< this seems to trigger the error
>   ;
> }
> 
> g++ -o mod/test1.os -c -g -DBOOST_DISABLE_THREADS -O3 -ftree-vectorize -fstrict-aliasing -ffast-math -DNDEBUG -Wall -fPIC -Isrc -I/usr/local/src/boost.hg -I/usr/include/python2.5 mod/test1.cc
> /usr/local/src/boost.hg/boost/python/to_python_value.hpp: In member function 'const PyTypeObject* boost::python::detail::shared_ptr_to_python_value<T>::get_pytype() const [with T = boost::shared_ptr<base>&]':
> /usr/local/src/boost.hg/boost/python/detail/caller.hpp:102:   instantiated from 'static const PyTypeObject* boost::python::detail::converter_target_type<ResultConverter>::get_pytype() [with ResultConverter = boost::python::to_python_value<boost::shared_ptr<base>&>]'
> /usr/local/src/boost.hg/boost/python/detail/caller.hpp:242:   instantiated from 'static boost::python::detail::py_func_sig_info boost::python::detail::caller_arity<1u>::impl<F, Policies, Sig>::signature() [with F = boost::python::detail::member<boost::shared_ptr<base>, Test>, Policies = boost::python::return_value_policy<boost::python::return_by_value, boost::python::default_call_policies>, Sig = boost::mpl::vector2<boost::shared_ptr<base>&, Test&>]'
> /usr/local/src/boost.hg/boost/python/object/py_function.hpp:48:   instantiated from 'boost::python::detail::py_func_sig_info boost::python::objects::caller_py_function_impl<Caller>::signature() const [with Caller = boost::python::detail::caller<boost::python::detail::member<boost::shared_ptr<base>, Test>, boost::python::return_value_policy<boost::python::return_by_value, boost::python::default_call_policies>, boost::mpl::vector2<boost::shared_ptr<base>&, Test&> >]'
> mod/test1.cc:22:   instantiated from here
> /usr/local/src/boost.hg/boost/python/to_python_value.hpp:109: error: no matching function for call to 'boost::python::detail::shared_ptr_to_python_value<boost::shared_ptr<base>&>::get_pytype(boost::type<boost::shared_ptr<base>&>*) const'
> /usr/local/src/boost.hg/boost/python/to_python_value.hpp:109: note: candidates are: const PyTypeObject* boost::python::detail::shared_ptr_to_python_value<T>::get_pytype() const [with T = boost::shared_ptr<base>&]
> scons: *** [mod/test1.os] Error 1
> scons: building terminated because of errors.
> 
> Compilation exited abnormally with code 2 at Wed Sep 12 07:18:15




More information about the Cplusplus-sig mailing list