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
f4ee2a22
Commit
f4ee2a22
authored
Oct 02, 2020
by
Xavier Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use 'auto f() -> decltype(callexpr)' for MRO and static cypclass hooks
parent
1b7e80f6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
8 deletions
+15
-8
Cython/Compiler/ModuleNode.py
Cython/Compiler/ModuleNode.py
+15
-8
No files found.
Cython/Compiler/ModuleNode.py
View file @
f4ee2a22
...
@@ -1796,16 +1796,20 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
...
@@ -1796,16 +1796,20 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
cname
=
e
.
cname
if
not
e
.
type
.
is_static_method
else
e
.
static_cname
cname
=
e
.
cname
if
not
e
.
type
.
is_static_method
else
e
.
static_cname
resolution
=
e
.
from_type
.
empty_declaration_code
()
call
=
"%s::%s(%s)"
%
(
resolution
,
cname
,
", "
.
join
(
arg_names
))
header
=
e
.
type
.
function_header_code
(
cname
,
", "
.
join
(
arg_decls
))
header
=
e
.
type
.
function_header_code
(
cname
,
", "
.
join
(
arg_decls
))
if
not
e
.
name
.
startswith
(
"operator "
):
if
not
e
.
name
.
startswith
(
"operator "
):
header
=
e
.
type
.
return_type
.
declaration_code
(
header
)
header
=
"auto %s -> decltype(%s)"
%
(
header
,
call
)
return_code
=
""
if
e
.
type
.
return_type
.
is_void
else
"return "
return_code
=
""
if
e
.
type
.
return_type
.
is_void
else
"return "
resolution
=
e
.
from_type
.
empty_declaration_code
()
body
=
"%s%s
::%s(%s);"
%
(
return_code
,
resolution
,
cname
,
", "
.
join
(
arg_names
)
)
body
=
"%s%s
;"
%
(
return_code
,
call
)
code
.
putln
(
"virtual %s%s {%s}"
%
(
modifiers
,
header
,
body
))
code
.
putln
(
"virtual %s%s {"
%
(
modifiers
,
header
))
code
.
putln
(
body
)
code
.
putln
(
"}"
)
if
inherited_methods
:
if
inherited_methods
:
code
.
putln
(
""
)
code
.
putln
(
""
)
...
@@ -1825,16 +1829,19 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
...
@@ -1825,16 +1829,19 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
arg_decls
.
append
(
func_type
.
op_arg_struct
.
declaration_code
(
opt_name
))
arg_decls
.
append
(
func_type
.
op_arg_struct
.
declaration_code
(
opt_name
))
arg_names
.
append
(
opt_name
)
arg_names
.
append
(
opt_name
)
call
=
"%s(%s)"
%
(
static_method
.
cname
,
", "
.
join
(
arg_names
))
header
=
func_type
.
function_header_code
(
static_method
.
static_cname
,
", "
.
join
(
arg_decls
))
header
=
func_type
.
function_header_code
(
static_method
.
static_cname
,
", "
.
join
(
arg_decls
))
if
not
static_method
.
name
.
startswith
(
"operator "
):
if
not
static_method
.
name
.
startswith
(
"operator "
):
header
=
func_type
.
return_type
.
declaration_code
(
header
)
header
=
"auto %s -> decltype(%s)"
%
(
header
,
call
)
return_code
=
""
if
func_type
.
return_type
.
is_void
else
"return "
return_code
=
""
if
func_type
.
return_type
.
is_void
else
"return "
body
=
"%s%s(%s);"
%
(
return_code
,
static_method
.
cname
,
", "
.
join
(
arg_names
))
body
=
"%s%s;"
%
(
return_code
,
call
)
code
.
putln
(
"virtual %s%s {%s}"
%
(
modifiers
,
header
,
body
))
code
.
putln
(
"virtual %s%s {"
%
(
modifiers
,
header
))
code
.
putln
(
body
)
code
.
putln
(
"}"
)
def
generate_enum_definition
(
self
,
entry
,
code
):
def
generate_enum_definition
(
self
,
entry
,
code
):
code
.
mark_pos
(
entry
.
pos
)
code
.
mark_pos
(
entry
.
pos
)
...
...
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