← Back to index
|
Original Bugzilla link
Bug 14395 – [REG2.067] Typesafe variadic function call collapsed if being used for default value
Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-04-02T14:48:00Z
Last change time
2015-06-17T21:04:13Z
Keywords
pull, wrong-code
Assigned to
nobody
Creator
coz.d.lang
Comments
Comment #0
by coz.d.lang — 2015-04-02T14:48:43Z
import std.stdio; struct V2u { union { uint[2] m; struct { uint x; uint y; } } this(uint[2] ar ...) { m[] = ar[]; } } void print(in V2u size = V2u(7, 8)) { writefln("size = %s, %s (%s, %s)", size.x, size.y, size.m[0], size.m[1]); } void main() { print(); print(V2u(11, 22)); } // output (dmd2.065) // size = 7, 8 (7, 8) // size = 11, 22 (11, 22) // output (dmd2.067) // size = 4313838, 4294967295 (4313838, 4294967295) // size = 11, 22 (11, 22)
Comment #1
by ketmar — 2015-04-02T15:08:32Z
slightly minimized sample: int V2u (uint[1] ar...) { return ar[0]; } void print (int size=V2u(7)) { assert(size == 7); } void main () { print(); }
Comment #2
by ag0aep6g — 2015-04-03T09:58:22Z
Introduced in
https://github.com/D-Programming-Language/dmd/pull/4015
Comment #3
by k.hara.pg — 2015-04-03T17:09:56Z
https://github.com/D-Programming-Language/dmd/pull/4551
Comment #4
by github-bugzilla — 2015-04-04T20:50:04Z
Commits pushed to master at
https://github.com/D-Programming-Language/dmd
https://github.com/D-Programming-Language/dmd/commit/9982f52fee882bd78143ce76e8547ef59c8e8454
fix Issue 14395 - Typesafe variadic function call collapsed if being used for default value Out of function body `__arrayArg` was not initialized by the array literal, because `VarDeclaraton::semantic()` does not wrap the initializer expression with ConstructExp when `sc->func == NULL`. To fix the issue, remove use of temporary variable for typesafe variadic argument.
https://github.com/D-Programming-Language/dmd/commit/e926becf170376bdefccb5fb1812c0214c7db324
Merge pull request #4551 from 9rnsr/fix14395 [REG2.067] Issue 14395 - Typesafe variadic function call collapsed if being used for default value
Comment #5
by github-bugzilla — 2015-04-17T14:09:53Z
Commit pushed to stable at
https://github.com/D-Programming-Language/dmd
https://github.com/D-Programming-Language/dmd/commit/1efec7b7aebb7581ece00c8cc1305d2e9c5fc735
Merge pull request #4551 from 9rnsr/fix14395 [REG2.067] Issue 14395 - Typesafe variadic function call collapsed if being used for default value
Comment #6
by github-bugzilla — 2015-04-26T00:04:40Z
Commit pushed to master at
https://github.com/D-Programming-Language/dmd
https://github.com/D-Programming-Language/dmd/commit/1efec7b7aebb7581ece00c8cc1305d2e9c5fc735
Merge pull request #4551 from 9rnsr/fix14395
Comment #7
by github-bugzilla — 2015-06-17T21:04:13Z
Commits pushed to stable at
https://github.com/D-Programming-Language/dmd
https://github.com/D-Programming-Language/dmd/commit/9982f52fee882bd78143ce76e8547ef59c8e8454
fix Issue 14395 - Typesafe variadic function call collapsed if being used for default value
https://github.com/D-Programming-Language/dmd/commit/e926becf170376bdefccb5fb1812c0214c7db324
Merge pull request #4551 from 9rnsr/fix14395