Bug 11074 – Template value parameter defaults behave differently for IFTI and normal instantations
Status
RESOLVED
Resolution
DUPLICATE
Severity
major
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-09-20T08:33:00Z
Last change time
2015-01-05T15:31:11Z
Assigned to
nobody
Creator
simen.kjaras
Comments
Comment #0 by simen.kjaras — 2013-09-20T08:33:21Z
void bar(int line = __LINE__)() {
pragma(msg, line);
}
void main() {
bar!()();
bar();
}
The two calls to bar should be equivalent, right? They're not. In the case of explicit instantiation, __LINE__ is evaluated to be 1, while with IFTI, it is 7.
Comment #1 by k.hara.pg — 2015-01-05T15:31:11Z
Fixed in 2.064. Now the snippet prints:
6
7
*** This issue has been marked as a duplicate of issue 4018 ***