1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
|
From: =?utf-8?q?Gonzalo_Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Sun, 18 Aug 2024 17:43:05 -0300
Subject: Better fix for #6122 to avoid #6535
The change in #6124 introduces a regression with functions that are
implicit noexcept in a pxd file.
Origin: https://github.com/cython/cython/pull/6343
Bug-Upstream: https://github.com/cython/cython/issues/6335
---
Cython/Compiler/Nodes.py | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/Cython/Compiler/Nodes.py b/Cython/Compiler/Nodes.py
index 6af9160..3bb33d8 100644
--- a/Cython/Compiler/Nodes.py
+++ b/Cython/Compiler/Nodes.py
@@ -717,10 +717,8 @@ class CFuncDeclaratorNode(CDeclaratorNode):
and not self.has_explicit_exc_clause
and self.exception_check
and visibility != 'extern'):
- # If function is already declared from pxd, the exception_check has already correct value.
- if not (self.declared_name() in env.entries and not in_pxd):
- self.exception_check = False
# implicit noexcept, with a warning
+ self.exception_check = False
warning(self.pos,
"Implicit noexcept declaration is deprecated."
" Function declaration should contain 'noexcept' keyword.",
@@ -3128,6 +3126,7 @@ class DefNode(FuncDefNode):
if scope is None:
scope = cfunc.scope
cfunc_type = cfunc.type
+ has_explicit_exc_clause=True
if len(self.args) != len(cfunc_type.args) or cfunc_type.has_varargs:
error(self.pos, "wrong number of arguments")
error(cfunc.pos, "previous declaration here")
|