Commit 0ce42ef1 authored by Xavier Thompson's avatar Xavier Thompson

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

parent 60421db2
......@@ -4241,9 +4241,16 @@ class IndexNode(_IndexingBaseNode):
else:
assert False, "unexpected base type in indexing: %s" % self.base.type
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>" % (
self.base.result(),
",".join([param.empty_declaration_code() for param in self.type_indices]))
",".join(template_strings))
elif self.base.type.is_ctuple:
index = self.index.constant_result
if index < 0:
......
......@@ -4863,9 +4863,16 @@ def best_match(arg_types, functions, pos=None, env=None, args=None, throw=False)
else:
type_list = [deductions[param] for param in func_type.templates]
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(
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),
pos = func.pos)
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