From fa945265d39d582946ec32bbfaddf05188a784e3 Mon Sep 17 00:00:00 2001 From: daniloaf Date: Thu, 4 Mar 2010 14:42:57 -0300 Subject: [PATCH] Fixed bug on overloaded methods from templated C++ classes and correct error for "opertator=" --- Cython/Compiler/Parsing.py | 2 +- Cython/Compiler/Symtab.py | 16 ++++++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/Cython/Compiler/Parsing.py b/Cython/Compiler/Parsing.py index b234963a..f08ecf2c 100644 --- a/Cython/Compiler/Parsing.py +++ b/Cython/Compiler/Parsing.py @@ -2092,7 +2092,7 @@ def p_c_simple_declarator(s, ctx, empty, is_type, cmethod_flag, error(s.position(), "Declarator should be empty") s.next() cname = p_opt_cname(s) - if s.sy == '=' and assignable: + if name != "operator" and s.sy == '=' and assignable: s.next() rhs = p_simple_expr(s) else: diff --git a/Cython/Compiler/Symtab.py b/Cython/Compiler/Symtab.py index 240e2c6f..ddb17f10 100644 --- a/Cython/Compiler/Symtab.py +++ b/Cython/Compiler/Symtab.py @@ -1560,7 +1560,6 @@ class CppClassScope(Scope): error(pos, "no matching function for call to " \ "%s::%s()" % (temp_entry.scope.name, temp_entry.scope.name)) elif not self.default_constructor: - print 5 error(pos, "no matching function for call to %s::%s()" % (self.default_constructor, self.default_constructor)) @@ -1607,11 +1606,16 @@ class CppClassScope(Scope): entry.pos, entry.cname) else: - scope.declare_var(entry.name, - entry.type.specialize(values), - entry.pos, - entry.cname, - entry.visibility) +# scope.declare_var(entry.name, +# entry.type.specialize(values), +# entry.pos, +# entry.cname, +# entry.visibility) + for e in entry.all_alternatives(): + scope.declare_cfunction(e.name, + e.type.specialize(values), + e.pos, + e.cname) return scope -- 2.26.2