Bug 14416 – .sizeof yields 1 for uninstantiated struct templates
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-04-06T05:03:00Z
Last change time
2015-06-17T21:04:24Z
Keywords
accepts-invalid, pull
Assigned to
nobody
Creator
andrei
Comments
Comment #0 by andrei — 2015-04-06T05:03:30Z
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.