[Issue 14416] New: .sizeof yields 1 for uninstantiated struct templates

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sun Apr 5 22:03:30 PDT 2015


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

          Issue ID: 14416
           Summary: .sizeof yields 1 for uninstantiated struct templates
           Product: D
           Version: D2
          Hardware: x86
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: DMD
          Assignee: nobody at puremagic.com
          Reporter: andrei at erdani.com

Consider:

struct S(T)
{
    int x;
}

void main()
{
    import std.stdio;
    writeln(S.sizeof);
    writeln(S!int.sizeof);
}

This program prints 1 4. The first call shouldn't compile.

--


More information about the Digitalmars-d-bugs mailing list