From: Stefan Behnel Date: Tue, 16 Feb 2010 08:29:31 +0000 (+0100) Subject: pure syntax-level merge of latest cython-devel - breaks all closure tests, likely... X-Git-Tag: 0.13.beta0~2^2~103 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=cd2c1a337ce861d8ab087362e91ee3cf0014bab9;p=cython.git pure syntax-level merge of latest cython-devel - breaks all closure tests, likely due to C++ changes --- cd2c1a337ce861d8ab087362e91ee3cf0014bab9 diff --cc Cython/Compiler/ExprNodes.py index 7df339c6,a6b52f7d..ca27f100 mode 100644,100755..100755 --- a/Cython/Compiler/ExprNodes.py +++ b/Cython/Compiler/ExprNodes.py @@@ -4051,7 -4083,8 +4122,8 @@@ class UnboundMethodNode(ExprNode) code.error_goto_if_null(self.result(), self.pos))) code.put_gotref(self.py_result()) + -class PyCFunctionNode(AtomicExprNode): +class PyCFunctionNode(ExprNode): # Helper class used in the implementation of Python # class definitions. Constructs a PyCFunction object # from a PyMethodDef struct. diff --cc Cython/Compiler/Nodes.py index 204975d7,fd4460cb..25534fc5 --- a/Cython/Compiler/Nodes.py +++ b/Cython/Compiler/Nodes.py @@@ -16,12 -17,12 +17,12 @@@ from Errors import error, warning, Inte import Naming import PyrexTypes import TypeSlots - from PyrexTypes import py_object_type, error_type, CTypedefType, CFuncType + from PyrexTypes import py_object_type, error_type, CFuncType -from Symtab import ModuleScope, LocalScope, GeneratorLocalScope, \ +from Symtab import ModuleScope, LocalScope, ClosureScope, \ - StructOrUnionScope, PyClassScope, CClassScope + StructOrUnionScope, PyClassScope, CClassScope, CppClassScope from Cython.Utils import open_new_file, replace_suffix from Code import UtilityCode - from StringEncoding import EncodedString, escape_byte_string, split_docstring + from StringEncoding import EncodedString, escape_byte_string, split_string_literal import Options import ControlFlow import DebugFlags diff --cc Cython/Compiler/Symtab.py index 51d90847,70de775d..44e1ca63 --- a/Cython/Compiler/Symtab.py +++ b/Cython/Compiler/Symtab.py @@@ -426,9 -434,13 +441,13 @@@ class Scope(object) cname = name else: cname = self.mangle(Naming.var_prefix, name) + if type.is_cpp_class and visibility != 'extern': + constructor = type.scope.lookup(u'') + if constructor is not None and PyrexTypes.best_match([], constructor.all_alternatives()) is None: + error(pos, "C++ class must have an empty constructor to be stack allocated") entry = self.declare(name, cname, type, pos, visibility) entry.is_variable = 1 - self.control_flow.set_state((), (name, 'initalized'), False) + self.control_flow.set_state((), (name, 'initialized'), False) return entry def declare_builtin(self, name, pos):