summaryrefslogtreecommitdiff
path: root/tests/run/cpp_smart_ptr.pyx
diff options
context:
space:
mode:
Diffstat (limited to 'tests/run/cpp_smart_ptr.pyx')
-rw-r--r--tests/run/cpp_smart_ptr.pyx11
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/run/cpp_smart_ptr.pyx b/tests/run/cpp_smart_ptr.pyx
index 7a249fbd3..d71151c5e 100644
--- a/tests/run/cpp_smart_ptr.pyx
+++ b/tests/run/cpp_smart_ptr.pyx
@@ -1,5 +1,5 @@
# mode: run
-# tag: cpp, werror, cpp11
+# tag: cpp, werror, cpp11, no-cpp-locals
from libcpp.memory cimport unique_ptr, shared_ptr, default_delete, dynamic_pointer_cast
from libcpp cimport nullptr
@@ -81,6 +81,15 @@ cdef cppclass C(B):
cdef shared_ptr[A] holding_subclass = shared_ptr[A](new C())
+
+def test_assignment_to_base_class():
+ """
+ >>> test_assignment_to_base_class()
+ """
+ cdef shared_ptr[C] derived = shared_ptr[C](new C())
+ cdef shared_ptr[A] base = derived
+
+
def test_dynamic_pointer_cast():
"""
>>> test_dynamic_pointer_cast()