id summary reporter owner description type status milestone component version severity resolution keywords cc 4003 "Error in destroy.hpp when methods ""T()"" and ""operator~()"" are defined." Christopher Bruns Dave Abrahams "I am wrapping a large library using boost python and Py++. I encountered a peculiar situation with one of the wrapped classes. I have attached a minimal example and an imperfect patch (see below). The problem occurs on line 33 of boost/python/detail/destroy.hpp: {{{ unpatched version: ================= 30 template 31 static void execute(T const volatile* p) 32 { 33 p->T::~T(); 34 } }}} The problem is that the class being wrapped has a member function ""T()"", and the class returned by that function has an ""operator~()""; which leads to a compile error. I have been working around this for the past year by patching the file destroy.hpp to use the name ""Type"" instead of ""T"" in this section, each time I install a new version of boost. {{{ patched version: =============== 30 template 31 static void execute(Type const volatile* p) 32 { 33 p->Type::~Type(); 34 } }}} That's not a complete solution, of course. I suspect I could concoct another scenario with classes that have a ""Type"" method etc. But it solves the problem for me with the libraries I am actually wrapping. Perhaps you C++ gurus could come up with a more robust approach. With the patch in place, my module compiles. Without the patch, I get these compiler messages: ############################################################# building 'foo_module' extension C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W3 /GS - /DNDEBUG ""-IC:/Program Files/boost/boost_1_42"" -I. -Ic:\Python26\include -Ic:\Pytho n26\PC /Tpwrap_foo.cpp /Fobuild\temp.win32-2.6\Release\wrap_foo.obj /EHsc -D""_HAS_TR1 =0"" wrap_foo.cpp C:/Program Files/boost/boost_1_42\boost/python/detail/destroy.hpp(33) : error C2523: 'Foo3::~T' : destructor tag mismatch C:/Program Files/boost/boost_1_42\boost/python/detail/destroy.hpp(95) : see reference to function template instantiation 'void boost::python::detail::value_destroyer::execute(volatile const T *)' being compiled with [ T=const Foo3 ] C:/Program Files/boost/boost_1_42\boost/python/detail/destroy.hpp(101) : see reference to function template instantiation 'void boost::python::detail::destroy_referent_impl(void *,T &(__cdecl *)(void))' being compiled with [ T=const Foo3 ] C:/Program Files/boost/boost_1_42\boost/python/converter/rvalue_from_python_data.hpp(135) : see reference to function template instantiation 'void boost::python::detail::destroy_referent(void *,T (__cdecl *)(void))' being compiled with [ T=const Foo3 & ] C:/Program Files/boost/boost_1_42\boost/python/converter/rvalue_from_python_data.hpp(133) : while compiling class template member function 'boost::python::converter::rvalue_from_python_data::~rvalue_from_python_data(void)' with [ T=const Foo3 & ] C:/Program Files/boost/boost_1_42\boost/python/converter/arg_from_python.hpp(124) : see reference to class template instantiation 'boost::python::converter::rvalue_from_python_data' being compiled with [ T=const Foo3 & ] C:/Program Files/boost/boost_1_42\boost/python/arg_from_python.hpp(27) : see reference to class template instantiation 'boost::python::converter::arg_rvalue_from_python' being compiled with [ T=const Foo3 & ] C:/Program Files/boost/boost_1_42\boost/preprocessor/iteration/detail/local.hpp(37) : see reference to class template instantiation 'boost::python::arg_from_python' being compiled with [ T=const Foo3 & ] C:/Program Files/boost/boost_1_42\boost/python/detail/caller.hpp(200) : while compiling class template member function 'PyObject *boost::python::detail::caller_arity<2>::impl::operator ()(PyObject *,PyObject *)' with [ F=void (__thiscall Foo4::* )(const Foo3 &), Policies=boost::python::default_call_policies, Sig=boost::mpl::vector3 ] C:/Program Files/boost/boost_1_42\boost/python/detail/caller.hpp(169) : see reference to class template instantiation 'boost::python::detail::caller_arity<2>::impl' being compiled with [ F=void (__thiscall Foo4::* )(const Foo3 &), Policies=boost::python::default_call_policies, Sig=boost::mpl::vector3 ] C:/Program Files/boost/boost_1_42\boost/python/make_function.hpp(61) : see reference to class template instantiation 'boost::python::detail::caller' being compiled with [ F=void (__thiscall Foo4::* )(const Foo3 &), CallPolicies=boost::python::default_call_policies, Sig=boost::mpl::vector3 ] C:/Program Files/boost/boost_1_42\boost/python/make_function.hpp(146) : see reference to function template instantiation 'boost::python::api::object boost::python::detail::make_function_aux>(F,const CallPolicies &,const Sig &,const boost::python::detail::keyword_range &,NumKeywords)' being compiled with [ F=void (__thiscall Foo4::* )(const Foo3 &), CallPolicies=boost::python::default_call_policies, Signature=boost::mpl::vector3, N=1, Sig=boost::mpl::vector3, NumKeywords=boost::mpl::int_<1> ] C:/Program Files/boost/boost_1_42\boost/python/class.hpp(544) : see reference to function template instantiation 'boost::python::api::object boost::python::make_function>(F,const CallPolicies &,const Keywords &,const Signature &)' being compiled with [ Fn=void (__thiscall Foo4::* )(const Foo3 &), T1=boost::python::detail::keywords<1>, T0=void, T2=const Foo3 &, F=void (__thiscall Foo4::* )(const Foo3 &), CallPolicies=boost::python::default_call_policies, Keywords=boost::python::detail::keywords<1>, Signature=boost::mpl::vector3 ] C:/Program Files/boost/boost_1_42\boost/python/class.hpp(614) : see reference to function template instantiation 'void boost::python::class_::def_impl>(T *,const char *,Fn,const Helper &,...)' being compiled with [ W=Foo4, Fn=void (__thiscall Foo4::* )(const Foo3 &), T1=boost::python::detail::keywords<1>, T=Foo4, Helper=boost::python::detail::def_helper> ] C:/Program Files/boost/boost_1_42\boost/python/class.hpp(244) : see reference to function template instantiation 'void boost::python::class_::def_maybe_overloads(const char *,Fn,const boost::python::detail::keywords<1> &,...)' being compiled with [ W=Foo4, A1=void (__thiscall Foo4::* )(const Foo3 &), A2=boost::python::detail::keywords<1>, Fn=void (__thiscall Foo4::* )(const Foo3 &) ] wrap_foo.cpp(21) : see reference to function template instantiation 'boost::python::class_ &boost::python::class_::def>(const char *,A1,const A2 &)' being compiled with [ W=Foo4, A1=void (__thiscall Foo4::* )(const Foo3 &), A2=boost::python::detail::keywords<1> ] error: command '""C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe""' failed with exit status 2 ######################################################### " Bugs closed Boost 1.43.0 python USE GITHUB Boost 1.42.0 Problem fixed cmbruns@…