www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 1956] New: Struct in 'for' statement breaks CTFE

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1956

           Summary: Struct in 'for' statement breaks CTFE
           Product: D
           Version: 2.012
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: samukha voliacable.com


Reopens 1363 (I messed up that one by posting two bugs in a single bug report)

----
struct S
{
    int x;
}

int foo()
{
    S s;
    for(; s.x < 10; s.x++)
    {
    }
    return s.x;
}

enum x = foo();
----
Error: cannot evaluate foo() at compile time (output twice)


-- 
Mar 28 2008
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1956


Don <clugdbug yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |clugdbug yahoo.com.au




--- Comment #1 from Don <clugdbug yahoo.com.au>  2009-07-21 06:29:36 PDT ---
Works for me (DMD 2.031).

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 21 2009
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1956


Max Samukha <samukha voliacable.com> changed:

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




-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 21 2009