Bug 1342 – struct const not accepted as initializer for another struct

Status
RESOLVED
Resolution
FIXED
Severity
minor
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2007-07-14T19:09:00Z
Last change time
2015-06-09T01:04:59Z
Keywords
rejects-valid
Assigned to
bugzilla
Creator
torhu

Comments

Comment #0 by torhu — 2007-07-14T19:09:41Z
--- struct S { int value; } const S s = { 5 }; const S t = s; // ok S u = s; // line 9, fails --- //newbug.d(9): Error: non-constant expression cast(S)s Making s invariant doesn't help.
Comment #1 by thomas-dloop — 2007-07-23T14:56:30Z
Comment #2 by torhu — 2007-09-15T09:08:42Z
Fixed dmd 2.004. Both my test case and the DStress test case works now.
Comment #3 by bugzilla — 2007-09-28T22:07:16Z
Fixed dmd 2.004