Skip to content

Commit

Permalink
fix Issue 14468 - overload mismatch for template instance with typesa…
Browse files Browse the repository at this point in the history
…fe variadic parameter
  • Loading branch information
9rnsr committed Apr 21, 2015
1 parent be8f360 commit 9c728ce
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/template.c
Expand Up @@ -1499,7 +1499,7 @@ MATCH TemplateDeclaration::deduceFunctionTemplateMatch(
if (argi >= nfargs) // if not enough arguments
{
if (!fparam->defaultArg)
goto Lnomatch;
goto Lvarargs;

/* Bugzilla 2803: Before the starting of type deduction from the function
* default arguments, set the already deduced parameters into paramscope.
Expand Down
5 changes: 5 additions & 0 deletions test/runnable/template9.d
Expand Up @@ -494,6 +494,9 @@ void normalize2803(R)(R range, ElementType2803!R sum = 1)
static assert(is(typeof(sum) == double));
}

auto foo14468(T)(T[]...) { return 1; }
auto foo14468(bool flag, T)(T[]...) { return 2; }

void test2803()
{
assert(foo2803() == 0);
Expand All @@ -519,6 +522,8 @@ void test2803()

double[] a = [];
normalize2803(a);

assert(foo14468!int() == 1);
}

/**********************************/
Expand Down

0 comments on commit 9c728ce

Please sign in to comment.