Bug 16115 – [REG2.067] Wrong code with comma operator

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2016-06-02T15:04:00Z
Last change time
2016-10-01T11:48:26Z
Keywords
wrong-code
Assigned to
nobody
Creator
dlang-bugzilla

Comments

Comment #0 by dlang-bugzilla — 2016-06-02T15:04:08Z
///////////////// test.d //////////////// int n; auto call() { // n = Test.tag; // Works return n = Test.tag, null; // Crash } struct Test { enum tag = 42; } void main() { call(); assert(n == 42); } ///////////////////////////////////////// Introduced in https://github.com/dlang/dmd/pull/3979
Comment #1 by bugzilla — 2016-07-27T07:46:22Z
Clearer test case: int n; auto call() { version (none) // works { n = Test.tag; return null; } else // assert error { return n = Test.tag, null; } } struct Test { enum tag = 42; } void main() { call(); assert(n == 42); }
Comment #2 by bugzilla — 2016-08-13T01:41:09Z
Comment #3 by github-bugzilla — 2016-08-13T14:11:54Z
Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/f9fd81983118d94a6f3da915e781c72b54a67247 fix Issue 16115 - [REG2.067] Wrong code with comma operator https://github.com/dlang/dmd/commit/113e5f77d335dc3483127b13073690981b6a61b6 Merge pull request #6054 from WalterBright/fix16115 fix Issue 16115 - [REG2.067] Wrong code with comma operator
Comment #4 by github-bugzilla — 2016-10-01T11:48:26Z
Commits pushed to stable at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/f9fd81983118d94a6f3da915e781c72b54a67247 fix Issue 16115 - [REG2.067] Wrong code with comma operator https://github.com/dlang/dmd/commit/113e5f77d335dc3483127b13073690981b6a61b6 Merge pull request #6054 from WalterBright/fix16115