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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
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
Show 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):
...
@@ -1924,7 +1924,7 @@ class FuncDefNode(StatNode, BlockNode):
code
.
mark_pos
(
self
.
pos
,
trace
=
False
)
code
.
mark_pos
(
self
.
pos
,
trace
=
False
)
code
.
putln
(
""
)
code
.
putln
(
""
)
code
.
putln
(
"/* function exit code */"
)
code
.
putln
(
"/* function exit code
X
*/"
)
# ----- Default return value
# ----- Default return value
if
not
self
.
body
.
is_terminator
:
if
not
self
.
body
.
is_terminator
:
...
...
Cython/Compiler/PyrexTypes.py
View file @
aae6c5c9
...
@@ -3666,8 +3666,11 @@ class CppClassType(CType):
...
@@ -3666,8 +3666,11 @@ class CppClassType(CType):
if
other_type
.
is_cpp_class
:
if
other_type
.
is_cpp_class
:
if
self
==
other_type
:
if
self
==
other_type
:
return
1
return
1
elif
(
self
.
cname
==
other_type
.
cname
# This messy logic is needed due to GH Issue #1852.
and
(
self
.
templates
or
other_type
.
templates
)):
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
:
if
self
.
templates
==
other_type
.
templates
:
return
1
return
1
for
t1
,
t2
in
zip
(
self
.
templates
,
other_type
.
templates
):
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):
...
@@ -125,3 +125,16 @@ def test_GH1599(a, b):
(1, 2.0)
(1, 2.0)
"""
"""
return
public_return_pair
(
a
,
b
)
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