Merge branch 'shared-ptr-template-upcast'

* shared-ptr-template-upcast:
  comments
  Applying shared_ptr template upcast fix to CSharp, adding CSharp test, and cleanup
  Adding test case demonstrating issue where SWIG does not generate a correctly typed, upcasted shared_ptr for a template instantiation deriving from a base class
  WIP - Use the non-encoded type string for upcasting a shared_ptr of a derived type to a shared_ptr of the base type
  comments
  Applying shared_ptr template upcast fix to CSharp, adding CSharp test, and cleanup
  Adding test case demonstrating issue where SWIG does not generate a correctly typed, upcasted shared_ptr for a template instantiation deriving from a base class
  WIP - Use the non-encoded type string for upcasting a shared_ptr of a derived type to a shared_ptr of the base type
This commit is contained in:
William S Fulton 2020-01-17 18:45:30 +00:00
commit 6910e5f09c
7 changed files with 143 additions and 10 deletions

View file

@ -35,6 +35,7 @@ CPP11_TEST_CASES = \
cpp11_shared_ptr_const \
cpp11_shared_ptr_nullptr_in_containers \
cpp11_shared_ptr_overload \
cpp11_shared_ptr_template_upcast \
cpp11_shared_ptr_upcast \
cpp11_strongly_typed_enumerations_simple \

View file

@ -0,0 +1,15 @@
// This is the cpp11_shared_ptr_template_upcast runtime testcase. It checks that SWIG generates the appropriate upcasted shared_ptr type for a template instantiation deriving from a base class.
// For this case, the expected behavior is: given a cptr with underlying type shared_ptr<Printable<Derived> >, PrintableDerived_SWIGSmartPtrUpcast returns a cptr with
// underlying type std::shared_ptr< Derived >, where Printable<Derived> inherits from Derived.
using System;
using cpp11_shared_ptr_template_upcastNamespace;
public class cpp11_shared_ptr_template_upcast_runme
{
static void Main()
{
PrintableDerived pd = cpp11_shared_ptr_template_upcast.MakePrintableDerived(20);
pd.GetResult();
pd.GetFormatted();
}
}