D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 2847 - ICE(cod4.c) return const(struct) with real member
Summary: ICE(cod4.c) return const(struct) with real member
Status: RESOLVED DUPLICATE of issue 2560
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86 Windows
: P1 normal
Assignee: No Owner
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2009-04-17 10:48 UTC by HOSOKAWA Kenchi
Modified: 2015-06-09 01:18 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description HOSOKAWA Kenchi 2009-04-17 10:48:08 UTC
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 Don 2009-04-17 12:24:14 UTC
An ICE on valid code is never trivial!
Comment 2 sa 2009-04-25 14:58:42 UTC
v2.029 has the same bug.

Raise to P1, since the compiler crashes.
Comment 3 Don 2009-08-31 02:22:44 UTC
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 ***