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
ebef63ea
Commit
ebef63ea
authored
Jan 19, 2012
by
Mark
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #79 from dtcaciuc/master
Fix C++ reference to C++ reference coercion
parents
59820426
b185d25f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
1 deletion
+46
-1
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+1
-1
tests/run/cpp_template_ref_args.h
tests/run/cpp_template_ref_args.h
+15
-0
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 @
ebef63ea
...
@@ -600,7 +600,7 @@ class ExprNode(Node):
...
@@ -600,7 +600,7 @@ class ExprNode(Node):
if
self
.
check_for_coercion_error
(
dst_type
):
if
self
.
check_for_coercion_error
(
dst_type
):
return
self
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
dst_type
=
dst_type
.
ref_base_type
if
src_type
.
is_fused
or
dst_type
.
is_fused
:
if
src_type
.
is_fused
or
dst_type
.
is_fused
:
...
...
tests/run/cpp_template_ref_args.h
0 → 100644
View file @
ebef63ea
#ifndef _TEMPLATE_ARGS_H_
#define _TEMPLATE_ARGS_H_
template
<
typename
T
>
struct
Bar
{
Bar
&
ref
()
{
return
*
this
;
}
T
value
;
};
template
<
typename
T
>
struct
Foo
{
int
bar_value
(
const
Bar
<
int
>
&
bar
)
{
return
bar
.
value
;
}
};
#endif
tests/run/cpp_template_ref_args.pyx
0 → 100644
View file @
ebef63ea
# 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