diff --git a/dmd/template.c b/dmd/template.c index 6a5d12bf..029a546a 100644 --- a/dmd/template.c +++ b/dmd/template.c @@ -814,7 +814,12 @@ MATCH TemplateDeclaration::deduceFunctionTemplateMatch(Loc loc, Objects *targsi, else n = nargsi; - memcpy(dedargs->data, targsi->data, n * sizeof(*dedargs->data)); + /* Test case for nargsi instead of n: + * string foo(T...)() { return ""; } + * void main() { foo!(int, char)(); } + */ + //memcpy(dedargs->data, targsi->data, n * sizeof(*dedargs->data)); + memcpy(dedargs->data, targsi->data, nargsi * sizeof(*dedargs->data)); for (size_t i = 0; i < n; i++) { assert(i < parameters->dim);