Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix 15668: __LINE__ evaluated at declaration context #5441

Merged
merged 1 commit into from
Feb 11, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/dtemplate.d
Original file line number Diff line number Diff line change
Expand Up @@ -1435,7 +1435,7 @@ public:
* 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 @@ -1453,7 +1453,7 @@ public:
}
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();
}