Skip to content

Commit

Permalink
Merge pull request dlang#5441 from Dicebot/fix-15668-default-line
Browse files Browse the repository at this point in the history
[REG2.068.0] Fix 15668: __LINE__ evaluated at declaration context
Conflicts:
	src/dtemplate.d
  • Loading branch information
tramker committed Feb 14, 2016
1 parent 5064cc1 commit 1747ac9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/template.c
Original file line number Diff line number Diff line change
Expand Up @@ -1540,7 +1540,7 @@ MATCH TemplateDeclaration::deduceFunctionTemplateMatch(
* the oded == oarg
*/
(*dedargs)[i] = oded;
MATCH m2 = tparam->matchArg(loc, paramscope, dedargs, i, parameters, dedtypes, NULL);
MATCH m2 = tparam->matchArg(instLoc, paramscope, dedargs, i, parameters, dedtypes, NULL);
//printf("m2 = %d\n", m2);
if (m2 <= MATCHnomatch)
goto Lnomatch;
Expand All @@ -1558,7 +1558,7 @@ MATCH TemplateDeclaration::deduceFunctionTemplateMatch(
}
else
{
oded = tparam->defaultArg(loc, paramscope);
oded = tparam->defaultArg(instLoc, paramscope);
if (oded)
(*dedargs)[i] = declareParameter(paramscope, tparam, oded);
}
Expand Down
9 changes: 9 additions & 0 deletions test/compilable/test15668.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
void foo ( int line = __LINE__ ) ( string msg = "" )
{
static assert (line == 8);
}

void main()
{
foo();
}

0 comments on commit 1747ac9

Please sign in to comment.