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
cb996d75
Commit
cb996d75
authored
Jul 28, 2020
by
Xavier Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Detect when an c++ operator is declared static and error out
parent
f48d77ec
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
0 deletions
+5
-0
Cython/Compiler/Symtab.py
Cython/Compiler/Symtab.py
+5
-0
No files found.
Cython/Compiler/Symtab.py
View file @
cb996d75
...
...
@@ -2953,6 +2953,9 @@ class CppClassScope(Scope):
def
declare_cfunction
(
self
,
name
,
type
,
pos
,
cname
=
None
,
visibility
=
'extern'
,
api
=
0
,
in_pxd
=
0
,
defining
=
0
,
modifiers
=
(),
utility_code
=
None
,
overridable
=
False
):
# Remember the original name because it might change
original_name
=
name
reify
=
self
.
type
.
is_cyp_class
and
self
.
type
.
activable
class_name
=
self
.
name
.
split
(
'::'
)[
-
1
]
if
name
in
(
class_name
,
'__init__'
)
and
cname
is
None
:
...
...
@@ -3013,6 +3016,8 @@ class CppClassScope(Scope):
reify
=
False
name
=
EncodedString
(
'operator '
+
as_operator_name
)
type
.
args
=
[]
if
name
.
startswith
(
"operator"
)
and
type
.
is_static_method
:
error
(
pos
,
"Operator %s cannot be a static method"
%
original_name
)
if
name
in
(
'<init>'
,
'<del>'
)
and
type
.
nogil
:
for
base
in
self
.
type
.
base_classes
:
...
...
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