From: SourceForge.net <no...@so...> - 2012-04-14 17:02:57
|
Bugs item #3333549, was opened at 2011-06-26 00:05 Message generated for change (Comment added) made by wsfulton You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101645&aid=3333549&group_id=1645 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: code generation (general) Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Johan Hake () Assigned to: William Fulton (wsfulton) Summary: upcast bug with shared_ptr Initial Comment: Polymorphism for shared_ptr declared templated classes which use typedef does not work. If a templated shared_ptr class hiearchy is declared which uses a typedef for the templated class, SWIG does not correctly resolve the correct class hierchy. This is illustrated by the minimal example attached, which fails when run. I am not sure it is related but in the generated wrapper code are shared_ptr types generated correctly for the typedefed template class Base<INT> and Derived<INT> #define SWIGTYPE_p_boost__shared_ptrT_BaseT_INT_t_t swig_types[2] #define SWIGTYPE_p_boost__shared_ptrT_DerivedT_INT_t_t swig_types[3] But only the corresponding none shared_ptr type is defined with the typedef resolved: #define SWIGTYPE_p_boost__shared_ptrT_BaseT_INT_t_t swig_types[2] #define SWIGTYPE_p_boost__shared_ptrT_DerivedT_INT_t_t swig_types[3] Johan ---------------------------------------------------------------------- >Comment By: William Fulton (wsfulton) Date: 2012-04-14 10:02 Message: Also note rev 12982 when coming back to this bug. ---------------------------------------------------------------------- Comment By: William Fulton (wsfulton) Date: 2012-04-14 09:40 Message: The fix has been reverted for swig-2.0.5 (svn revision 12953) as it introduces other %shared_ptr regressions. To be looked at later... ---------------------------------------------------------------------- Comment By: William Fulton (wsfulton) Date: 2011-08-12 17:36 Message: You can move the typedef to above the %shared_ptr statements so that the type information is fully available. However, I've fixed your example for swig-2.0.5 so that it works as you'd hope it to. ---------------------------------------------------------------------- Comment By: William Fulton (wsfulton) Date: 2011-06-29 23:31 Message: In cplus_inherit_types_impl() in typepass.cxx, smart = SwigType_typedef_resolve_all(spt); is failing to resolve spt == "boost::shared_ptr<(Derived<(INTT)>)>" ---------------------------------------------------------------------- Comment By: Johan Hake () Date: 2011-06-26 00:16 Message: The last two #defines in the description should be #define SWIGTYPE_p_BaseT_int_t swig_types[0] #define SWIGTYPE_p_DerivedT_int_t swig_types[1] Note the *int* instead of *INT* Johan ---------------------------------------------------------------------- Comment By: Johan Hake () Date: 2011-06-26 00:11 Message: The handed test has been checked failing for SWIG version 2.0.4 on a Linux box The bug can be reproduced by downloading the files and type make Johan ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101645&aid=3333549&group_id=1645 |