Bug 12438 – Wrong code for result of assignment to `ref`/`out` struct parameter

Status
RESOLVED
Resolution
WORKSFORME
Severity
critical
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-03-22T01:30:00Z
Last change time
2014-07-30T06:52:35Z
Keywords
wrong-code
Assigned to
nobody
Creator
verylonglogin.reg

Comments

Comment #0 by verylonglogin.reg — 2014-03-22T01:30:40Z
This code should run fine: --- struct S { int i; } void f(ref S s1) { assert((s1 = S()) == S()); // fails } void main() { S s1; f(s1); } ---
Comment #1 by yebblies — 2014-07-29T15:47:08Z
It does now.
Comment #2 by verylonglogin.reg — 2014-07-30T06:02:15Z
It was a critical issue. In what exact commit it was fixed and is it really fixed or this test-case just accidentally works? Anyway the test must be added to autotester.
Comment #3 by yebblies — 2014-07-30T06:52:35Z
(In reply to Denis Shelomovskij from comment #2) > It was a critical issue. In what exact commit it was fixed and is it really > fixed or this test-case just accidentally works? Anyway the test must be > added to autotester. You're right! Please track down the commit that fixed this and make a pull request to add the test case.