Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
aae6c5c9
Commit
aae6c5c9
authored
Aug 31, 2017
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More complete test and fix for template specialization issues.
Partial workaround for Github Issue #1852.
parent
97d39fea
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
3 deletions
+19
-3
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+1
-1
Cython/Compiler/PyrexTypes.py
Cython/Compiler/PyrexTypes.py
+5
-2
tests/run/cpp_template_subclasses.pyx
tests/run/cpp_template_subclasses.pyx
+13
-0
No files found.
Cython/Compiler/Nodes.py
View file @
aae6c5c9
...
...
@@ -1924,7 +1924,7 @@ class FuncDefNode(StatNode, BlockNode):
code
.
mark_pos
(
self
.
pos
,
trace
=
False
)
code
.
putln
(
""
)
code
.
putln
(
"/* function exit code */"
)
code
.
putln
(
"/* function exit code
X
*/"
)
# ----- Default return value
if
not
self
.
body
.
is_terminator
:
...
...
Cython/Compiler/PyrexTypes.py
View file @
aae6c5c9
...
...
@@ -3666,8 +3666,11 @@ class CppClassType(CType):
if
other_type
.
is_cpp_class
:
if
self
==
other_type
:
return
1
elif
(
self
.
cname
==
other_type
.
cname
and
(
self
.
templates
or
other_type
.
templates
)):
# This messy logic is needed due to GH Issue #1852.
elif
(
self
.
cname
==
other_type
.
cname
and
(
self
.
template_type
and
other_type
.
template_type
or
self
.
templates
or
other_type
.
templates
)):
if
self
.
templates
==
other_type
.
templates
:
return
1
for
t1
,
t2
in
zip
(
self
.
templates
,
other_type
.
templates
):
...
...
tests/run/cpp_template_subclasses.pyx
View file @
aae6c5c9
...
...
@@ -125,3 +125,16 @@ def test_GH1599(a, b):
(1, 2.0)
"""
return
public_return_pair
(
a
,
b
)
# Related to GH Issue #1852.
cdef
cppclass
Callback
[
T
]:
#(UntypedCallback):
pass
cdef
cppclass
MyClass
[
O
]:
void
Invoke
(
Callback
[
O
]
*
)
cdef
cppclass
MySubclass
[
T
](
MyClass
[
T
]):
void
Invoke
(
Callback
[
T
]
*
callback
):
pass
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment