Bug 609 – Const struct member is a non-constant expression

Status
RESOLVED
Resolution
FIXED
Severity
blocker
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
Windows
Creation time
2006-11-27T09:28:00Z
Last change time
2014-02-15T13:19:40Z
Keywords
rejects-valid
Assigned to
nobody
Creator
smjg

Comments

Comment #0 by smjg — 2006-11-27T09:28:58Z
---------- struct MyStruct { int i; } const MyStruct a = { 42 }; MyStruct b = { a.i }; ---------- const_struct_1.d(4): Error: non-constant expression *(& a) ---------- Changing line 4 to int b = a.i; gives the same error.
Comment #1 by samukha — 2007-08-31T06:10:57Z
I'm changing the severity and compiler version because this one is a blocker for me.
Comment #2 by matti.niemenmaa+dbugzilla — 2007-08-31T06:28:35Z
Comment #3 by samukha — 2007-08-31T06:48:38Z
Sorry, I hadn't read that post.
Comment #4 by clugdbug — 2009-07-22T04:31:23Z
Works for me Windows DMD1.046. Fixed long ago.