Fixed bug on overloaded methods from templated C++ classes and correct
authordaniloaf <none@none>
Thu, 4 Mar 2010 17:42:57 +0000 (14:42 -0300)
committerdaniloaf <none@none>
Thu, 4 Mar 2010 17:42:57 +0000 (14:42 -0300)
error for "opertator="

Cython/Compiler/Parsing.py
Cython/Compiler/Symtab.py

index b234963aa1fda1d169653dbd7f36b0c4973664c3..f08ecf2c5fb37d2bf1b853ff8bac31de93aaa5d5 100644 (file)
@@ -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:
index 240e2c6fa78426158398abb05ddaec694cf10743..ddb17f10f8fe9d5cda39b105e507236185886b14 100644 (file)
@@ -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