[Issue 20564] Member function increases struct size when the struct is defined in a function

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Feb 7 19:22:07 UTC 2020


https://issues.dlang.org/show_bug.cgi?id=20564

Basile-z <b2.temp at gmx.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |b2.temp at gmx.com

--- Comment #2 from Basile-z <b2.temp at gmx.com> ---
set the inner struct static when the context pointer is not required

void fun()
{
    static struct InnerFun
    {
        ubyte a;
        void fun() {}
    }
    static struct InnerNoFun
    {
        ubyte a;
    }
}

both have size 1 now.

--


More information about the Digitalmars-d-bugs mailing list