[Issue 4961] ICE(interpret.c) Tuple in union as part of static struct member

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Sep 16 08:57:25 PDT 2011


http://d.puremagic.com/issues/show_bug.cgi?id=4961


Simen Kjaeraas <simen.kjaras at gmail.com> changed:

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


--- Comment #2 from Simen Kjaeraas <simen.kjaras at gmail.com> 2011-09-16 08:57:00 PDT ---
This example has been reduced to a limitation of CTFE. The original problem is
gone. The below code works as expected:

struct Fields4961 { int x; }
struct bar4961 {
    union {
       int[1] value;
       Fields4961 fields;
    }

    this( int r ) {
       fields.x = r;       
    }    
}
static bar4961 b4961; // No longer initialized here. No CTFE problems.

static this( ) {
    b4961 = bar4961( 0 );
}

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


More information about the Digitalmars-d-bugs mailing list