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
Boxiang Sun
cython
Commits
c711c46a
Commit
c711c46a
authored
Mar 29, 2012
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix T767 - template specialization leaks into builtin types
parent
058a5e89
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
5 deletions
+12
-5
Cython/Compiler/Symtab.py
Cython/Compiler/Symtab.py
+8
-5
tests/compile/cpp_templates.pyx
tests/compile/cpp_templates.pyx
+4
-0
No files found.
Cython/Compiler/Symtab.py
View file @
c711c46a
...
...
@@ -412,7 +412,8 @@ class Scope(object):
return entry
def declare_type(self, name, type, pos,
cname = None, visibility = 'private', api = 0, defining = 1, shadow = 0):
cname = None, visibility = 'private', api = 0, defining = 1,
shadow = 0, template = 0):
# Add an entry for a type definition.
if not cname:
cname = name
...
...
@@ -422,7 +423,8 @@ class Scope(object):
if defining:
self.type_entries.append(entry)
type.entry = entry
if not template:
type.entry = entry
# here we would set as_variable to an object representing this type
return entry
...
...
@@ -2052,9 +2054,10 @@ class CppClassScope(Scope):
for
entry
in
self
.
entries
.
values
():
if
entry
.
is_type
:
scope
.
declare_type
(
entry
.
name
,
entry
.
type
.
specialize
(
values
),
entry
.
pos
,
entry
.
cname
)
entry
.
type
.
specialize
(
values
),
entry
.
pos
,
entry
.
cname
,
template
=
1
)
else
:
# scope.declare_var(entry.name,
# entry.type.specialize(values),
...
...
tests/compile/cpp_templates.pyx
View file @
c711c46a
# tag: cpp
# mode: compile
# ticket: 767
cdef
extern
from
"templates.h"
:
cdef
cppclass
TemplateTest1
[
T
]:
...
...
@@ -35,3 +36,6 @@ del b, e
ctypedef
TemplateTest1
[
int
]
TemplateTest1_int
cdef
TemplateTest1_int
aa
# Verify that T767 is fixed.
cdef
public
int
func
(
int
arg
):
return
arg
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