Bug 18746 – function returning empty struct isn't called if used in equality expression
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2018-04-08T19:53:16Z
Last change time
2018-04-17T10:17:58Z
Keywords
wrong-code
Assigned to
RazvanN
Creator
ag0aep6g
Comments
Comment #0 by ag0aep6g — 2018-04-08T19:53:16Z
Code is very similar to issue 12486, but apparently it's a different bug.
----
struct S {}
S f(ref int i)
{
++i;
return S();
}
void main()
{
int i = 2;
assert(f(i) == S());
assert(i == 3); /* fails, i = 2; should pass */
}
----
Comment #1 by razvan.nitu1305 — 2018-04-09T15:45:32Z