Bug 2847 – ICE(cod4.c) return const(struct) with real member
Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2009-04-17T10:48:00Z
Last change time
2015-06-09T01:18:23Z
Keywords
ice-on-valid-code
Assigned to
nobody
Creator
hskwk
Comments
Comment #0 by hskwk — 2009-04-17T10:48:08Z
Internal error: ..\ztc\cod4.c 353
struct S { real v; }
S f() { S s; return s; }
const(S) g() { return f(); }
condition:
S includes `real' member variable (i.e. it will work when v is float or double).
g() returns type const(S) (i.e. it will work when return type is S).
g() directly returns return value of f() (i.e. it will work when return value of f() is assigned in local variable).
Comment #1 by clugdbug — 2009-04-17T12:24:14Z
An ICE on valid code is never trivial!
Comment #2 by someanon — 2009-04-25T14:58:42Z
v2.029 has the same bug.
Raise to P1, since the compiler crashes.
Comment #3 by clugdbug — 2009-08-31T02:22:44Z
This is exactly the same as 2665, which is itself the same as 2560.
*** This issue has been marked as a duplicate of issue 2560 ***