Commit cac3dcbd authored by Xavier Thompson's avatar Xavier Thompson

Fix template function calls not generating 'pointer-to-cypclass' template parameters

parent d07a45ed
...@@ -4190,9 +4190,16 @@ class IndexNode(_IndexingBaseNode): ...@@ -4190,9 +4190,16 @@ class IndexNode(_IndexingBaseNode):
else: else:
assert False, "unexpected base type in indexing: %s" % self.base.type assert False, "unexpected base type in indexing: %s" % self.base.type
elif self.base.type.is_cfunction: elif self.base.type.is_cfunction:
template_strings = [
"%s%s" % (
param.empty_declaration_code(),
"*" if param.is_cyp_class else ""
)
for param in self.type_indices
]
return "%s<%s>" % ( return "%s<%s>" % (
self.base.result(), self.base.result(),
",".join([param.empty_declaration_code() for param in self.type_indices])) ",".join(template_strings))
elif self.base.type.is_ctuple: elif self.base.type.is_ctuple:
index = self.index.constant_result index = self.index.constant_result
if index < 0: if index < 0:
......
...@@ -4794,9 +4794,16 @@ def best_match(arg_types, functions, pos=None, env=None, args=None, throw=False) ...@@ -4794,9 +4794,16 @@ def best_match(arg_types, functions, pos=None, env=None, args=None, throw=False)
else: else:
type_list = [deductions[param] for param in func_type.templates] type_list = [deductions[param] for param in func_type.templates]
from .Symtab import Entry from .Symtab import Entry
template_cstrings = [
"%s%s" % (
t.empty_declaration_code(),
"*" if t.is_cyp_class else ""
)
for t in type_list
]
specialization = Entry( specialization = Entry(
name = func.name + "[%s]" % ",".join([str(t) for t in type_list]), name = func.name + "[%s]" % ",".join([str(t) for t in type_list]),
cname = func.cname + "<%s>" % ",".join([t.empty_declaration_code() for t in type_list]), cname = func.cname + "<%s>" % ",".join(template_cstrings),
type = func_type.specialize(deductions), type = func_type.specialize(deductions),
pos = func.pos) pos = func.pos)
candidates.append((specialization, specialization.type)) candidates.append((specialization, specialization.type))
......
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