[Issue 6419] [CTFE] Cannot create a non-static nested struct

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Dec 29 02:51:47 PST 2011


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


Don <clugdbug at yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[CTFE] Cannot create a      |[CTFE] Cannot create a
                   |nested struct if it has a   |non-static nested struct
                   |constructor                 |
         OS/Version|Mac OS X                    |All


--- Comment #5 from Don <clugdbug at yahoo.com.au> 2011-12-29 02:50:58 PST ---
Actually, it doesn't need a constructor. The presence of _any_ member function
triggers the bug:

static assert({
    struct Result {
        void foo(){}
    }
    Result x;
    return true;
}());

If it doesn't have any member functions, then it is actually a static nested
struct. So true nested structs are never supported in CTFE.

It's because the hidden member of the struct needs a pointer to the enclosing
function, and this is not implemented.

-- 
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