summaryrefslogtreecommitdiff
path: root/tests/wrappers
diff options
context:
space:
mode:
authorRobert Bradshaw <robertwb@gmail.com>2016-11-15 20:56:59 -0800
committerRobert Bradshaw <robertwb@gmail.com>2016-11-15 20:56:59 -0800
commitff0fc55b6af6641fa67d43d6238a52770676c8fd (patch)
tree1270066d2afaddfe9168791ed73e7f7dd7255448 /tests/wrappers
parentf8c223d7b6a21380b3db46af05ce8e3ed03a0c8a (diff)
downloadcython-ff0fc55b6af6641fa67d43d6238a52770676c8fd.tar.gz
Allow taking address of fake references.
This fixes #1519.
Diffstat (limited to 'tests/wrappers')
-rw-r--r--tests/wrappers/cpp_references.pyx11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/wrappers/cpp_references.pyx b/tests/wrappers/cpp_references.pyx
index cc8a0b901..10b8bc416 100644
--- a/tests/wrappers/cpp_references.pyx
+++ b/tests/wrappers/cpp_references.pyx
@@ -5,6 +5,7 @@ cimport cython
cdef extern from "cpp_references_helper.h":
cdef int& ref_func(int&)
+ cdef int& except_ref_func "ref_func" (int&) except +
cdef int ref_var_value
cdef int& ref_var
@@ -29,6 +30,16 @@ def test_ref_func_address(int x):
cdef int* i_ptr = &ref_func(x)
return i_ptr[0]
+def test_except_ref_func_address(int x):
+ """
+ >>> test_except_ref_func_address(5)
+ 5
+ >>> test_except_ref_func_address(7)
+ 7
+ """
+ cdef int* i_ptr = &except_ref_func(x)
+ return i_ptr[0]
+
def test_ref_var(int x):
"""
>>> test_ref_func(11)