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
Gwenaël Samain
cython
Commits
b185d25f
Commit
b185d25f
authored
Jan 18, 2012
by
Dimitri Tcaciuc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for a failing case of template reference arguments
with some improvements to previously committed test case
parent
d80abcdd
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
34 additions
and
20 deletions
+34
-20
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+1
-1
tests/bugs.txt
tests/bugs.txt
+0
-1
tests/compile/cpp_template_args.pyx
tests/compile/cpp_template_args.pyx
+0
-17
tests/run/cpp_template_ref_args.h
tests/run/cpp_template_ref_args.h
+3
-1
tests/run/cpp_template_ref_args.pyx
tests/run/cpp_template_ref_args.pyx
+30
-0
No files found.
Cython/Compiler/ExprNodes.py
View file @
b185d25f
...
...
@@ -600,7 +600,7 @@ class ExprNode(Node):
if
self
.
check_for_coercion_error
(
dst_type
):
return
self
if
dst_type
.
is_reference
:
if
dst_type
.
is_reference
and
not
src_type
.
is_reference
:
dst_type
=
dst_type
.
ref_base_type
if
src_type
.
is_fused
or
dst_type
.
is_fused
:
...
...
tests/bugs.txt
View file @
b185d25f
...
...
@@ -8,7 +8,6 @@ missing_baseclass_in_predecl_T262
cfunc_call_tuple_args_T408
compile.cpp_operators
cpp_templated_ctypedef
cpp_template_args
cpp_structs
function_as_method_T494
closure_inside_cdef_T554
...
...
tests/compile/cpp_template_args.pyx
deleted
100644 → 0
View file @
d80abcdd
cdef
extern
from
"template_args.h"
:
cdef
cppclass
Bar
[
T
]:
Bar
()
cdef
cppclass
Foo
[
T
]:
Foo
()
void
set_bar
(
Bar
[
size_t
]
&
bar
)
cpdef
func
():
cdef
Foo
[
int
]
foo
cdef
Bar
[
size_t
]
bar
cdef
Bar
[
size_t
]
&
bref
=
bar
foo
.
set_bar
(
bref
)
tests/
compile/template
_args.h
→
tests/
run/cpp_template_ref
_args.h
View file @
b185d25f
...
...
@@ -3,11 +3,13 @@
template
<
typename
T
>
struct
Bar
{
Bar
&
ref
()
{
return
*
this
;
}
T
value
;
};
template
<
typename
T
>
struct
Foo
{
void
set_bar
(
const
Bar
[
size_t
]
&
bar
)
{
}
int
bar_value
(
const
Bar
<
int
>
&
bar
)
{
return
bar
.
value
;
}
};
#endif
tests/run/cpp_template_ref_args.pyx
0 → 100644
View file @
b185d25f
# tag: cpp
cdef
extern
from
"cpp_template_ref_args.h"
:
cdef
cppclass
Bar
[
T
]:
Bar
()
Bar
[
T
]
&
ref
()
T
value
cdef
cppclass
Foo
[
T
]:
Foo
()
int
bar_value
(
Bar
[
int
]
&
bar
)
def
test_template_ref_arg
(
int
x
):
"""
>>> test_template_ref_arg(4)
4
"""
# Templated reference parameters in method
# of templated classes were not properly coalesced.
cdef
Foo
[
size_t
]
foo
cdef
Bar
[
int
]
bar
bar
.
value
=
x
return
foo
.
bar_value
(
bar
.
ref
())
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