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
8d153541
Commit
8d153541
authored
Dec 08, 2020
by
Xavier Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix attribute decref method in template cypclasses
parent
43467205
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
2 deletions
+15
-2
Cython/Compiler/ModuleNode.py
Cython/Compiler/ModuleNode.py
+6
-2
tests/compile/cypclass_template_attributes.pyx
tests/compile/cypclass_template_attributes.pyx
+9
-0
No files found.
Cython/Compiler/ModuleNode.py
View file @
8d153541
...
...
@@ -950,13 +950,17 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
Generate destructor definition for the given cypclass entry.
"""
scope
=
entry
.
type
.
scope
type
=
entry
.
type
scope
=
type
.
scope
cypclass_attrs
=
[
e
for
e
in
scope
.
var_entries
if
e
.
type
.
is_cyp_class
and
not
e
.
name
==
"this"
and
not
e
.
is_type
]
if
cypclass_attrs
:
cypclass_attrs_destructor_name
=
"%s__cypclass_attrs_destructor__%s"
%
(
Naming
.
func_prefix
,
entry
.
name
)
destructor_with_namespace
=
"void %s::%s()"
%
(
entry
.
type
.
empty_declaration_code
(),
cypclass_attrs_destructor_name
)
destructor_with_namespace
=
"void %s::%s()"
%
(
type
.
empty_declaration_code
(),
cypclass_attrs_destructor_name
)
if
type
.
templates
:
templates_code
=
"template <typename %s>"
%
", typename "
.
join
(
t
.
name
for
t
in
type
.
templates
)
code
.
putln
(
templates_code
)
code
.
putln
(
destructor_with_namespace
)
code
.
putln
(
"{"
)
for
attr
in
cypclass_attrs
:
...
...
tests/compile/cypclass_template_attributes.pyx
0 → 100644
View file @
8d153541
# tag: cpp
# mode: compile
cdef
cypclass
B
:
pass
cdef
cypclass
A
[
T
]:
T
t
B
b
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