Commit fa945265 authored by daniloaf's avatar daniloaf

Fixed bug on overloaded methods from templated C++ classes and correct

error for "opertator="
parent 026e3de9
...@@ -2092,7 +2092,7 @@ def p_c_simple_declarator(s, ctx, empty, is_type, cmethod_flag, ...@@ -2092,7 +2092,7 @@ def p_c_simple_declarator(s, ctx, empty, is_type, cmethod_flag,
error(s.position(), "Declarator should be empty") error(s.position(), "Declarator should be empty")
s.next() s.next()
cname = p_opt_cname(s) cname = p_opt_cname(s)
if s.sy == '=' and assignable: if name != "operator" and s.sy == '=' and assignable:
s.next() s.next()
rhs = p_simple_expr(s) rhs = p_simple_expr(s)
else: else:
......
...@@ -1560,7 +1560,6 @@ class CppClassScope(Scope): ...@@ -1560,7 +1560,6 @@ class CppClassScope(Scope):
error(pos, "no matching function for call to " \ error(pos, "no matching function for call to " \
"%s::%s()" % (temp_entry.scope.name, temp_entry.scope.name)) "%s::%s()" % (temp_entry.scope.name, temp_entry.scope.name))
elif not self.default_constructor: elif not self.default_constructor:
print 5
error(pos, "no matching function for call to %s::%s()" % error(pos, "no matching function for call to %s::%s()" %
(self.default_constructor, self.default_constructor)) (self.default_constructor, self.default_constructor))
...@@ -1607,11 +1606,16 @@ class CppClassScope(Scope): ...@@ -1607,11 +1606,16 @@ class CppClassScope(Scope):
entry.pos, entry.pos,
entry.cname) entry.cname)
else: else:
scope.declare_var(entry.name, # scope.declare_var(entry.name,
entry.type.specialize(values), # entry.type.specialize(values),
entry.pos, # entry.pos,
entry.cname, # entry.cname,
entry.visibility) # entry.visibility)
for e in entry.all_alternatives():
scope.declare_cfunction(e.name,
e.type.specialize(values),
e.pos,
e.cname)
return scope return scope
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment