www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 1342] New: struct const not accepted as initializer for another struct

reply d-bugmail puremagic.com writes:
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 digitalmars.com
        ReportedBy: torhu 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.


-- 
Jul 14 2007
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1342






test case
http://dstress.kuehne.cn/run/const_15.d


-- 
Jul 23 2007
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1342


torhu yahoo.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED





Fixed dmd 2.004.  Both my test case and the DStress test case works now.


-- 
Sep 15 2007
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1342






Fixed dmd 2.004


-- 
Sep 28 2007