[Issue 1342] New: struct const not accepted as initializer for another struct
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sat Jul 14 17:09:42 PDT 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1342
Summary: struct const not accepted as initializer for another
struct
Product: D
Version: 2.002
Platform: PC
OS/Version: Windows
Status: NEW
Keywords: rejects-valid
Severity: minor
Priority: P2
Component: DMD
AssignedTo: bugzilla at digitalmars.com
ReportedBy: torhu at yahoo.com
---
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.
--
More information about the Digitalmars-d-bugs
mailing list