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
78871be7
Commit
78871be7
authored
Feb 18, 2010
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
C++ class constructor calls.
parent
b6df7f92
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
3 deletions
+14
-3
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+9
-0
Cython/Compiler/PyrexTypes.py
Cython/Compiler/PyrexTypes.py
+2
-0
Cython/Compiler/Symtab.py
Cython/Compiler/Symtab.py
+1
-0
tests/run/cpp_nested_templates.pyx
tests/run/cpp_nested_templates.pyx
+2
-3
No files found.
Cython/Compiler/ExprNodes.py
View file @
78871be7
...
...
@@ -2453,6 +2453,15 @@ class CallNode(ExprNode):
self
.
analyse_types
(
env
)
self
.
coerce_to
(
type
,
env
)
return
True
elif
type
and
type
.
is_cpp_class
:
for
arg
in
self
.
args
:
arg
.
analyse_types
(
env
)
constructor
=
type
.
scope
.
lookup
(
"<init>"
)
self
.
function
=
RawCNameExprNode
(
self
.
function
.
pos
,
constructor
.
type
)
self
.
function
.
entry
=
constructor
self
.
function
.
set_cname
(
type
.
declaration_code
(
""
))
self
.
analyse_c_function_call
(
env
)
return
True
def
nogil_check
(
self
,
env
):
func_type
=
self
.
function_type
()
...
...
Cython/Compiler/PyrexTypes.py
View file @
78871be7
...
...
@@ -1890,6 +1890,8 @@ class CppClassType(CType):
def
assignable_from_resolved_type
(
self
,
other_type
):
# TODO: handle operator=(...) here?
if
other_type
is
error_type
:
return
True
return
other_type
.
is_cpp_class
and
other_type
.
is_subclass
(
self
)
def
attributes_known
(
self
):
...
...
Cython/Compiler/Symtab.py
View file @
78871be7
...
...
@@ -1536,6 +1536,7 @@ class CppClassScope(Scope):
api
=
0
,
in_pxd
=
0
,
modifiers
=
()):
if
name
==
self
.
name
.
split
(
'::'
)[
-
1
]
and
cname
is
None
:
name
=
'<init>'
type
.
return_type
=
self
.
lookup
(
self
.
name
).
type
prev_entry
=
self
.
lookup_here
(
name
)
entry
=
self
.
declare_var
(
name
,
type
,
pos
,
cname
,
visibility
)
if
prev_entry
:
...
...
tests/run/cpp_nested_templates.pyx
View file @
78871be7
...
...
@@ -22,8 +22,7 @@ def test_wrap_pair(int i, double x):
(2, 2.25, True)
"""
try
:
pair
=
new
Pair
[
int
,
double
](
i
,
x
)
wrap
=
new
Wrap
[
Pair
[
int
,
double
]](
deref
(
pair
))
wrap
=
new
Wrap
[
Pair
[
int
,
double
]](
Pair
[
int
,
double
](
i
,
x
))
return
wrap
.
get
().
first
(),
wrap
.
get
().
second
(),
deref
(
wrap
)
==
deref
(
wrap
)
finally
:
del
pair
,
wrap
del
wrap
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