D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 15668 - [REG2.068.0] __LINE__ evaluated at declaration context
Summary: [REG2.068.0] __LINE__ evaluated at declaration context
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P1 regression
Assignee: No Owner
URL:
Keywords: rejects-valid, wrong-code
Depends on:
Blocks:
 
Reported: 2016-02-10 05:55 UTC by Dicebot
Modified: 2016-02-11 11:55 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Dicebot 2016-02-10 05:55:00 UTC
---
void foo ( int line = __LINE__ ) ( int x = 42 )
{
    static assert (line == 8);
}

void main()
{
    foo();
}
// Error: static assert  (1 == 8) is false
//     instantiated from here: foo!1
---

According to `git bisect` regression was introduced by https://github.com/D-Programming-Language/dmd/pull/4261 (between 2.067 and 2.068) and it still fails on 2.070
Comment 1 Dicebot 2016-02-10 06:56:40 UTC
Fix attempt https://github.com/D-Programming-Language/dmd/pull/5435