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.
Comment #1 by k.hara.pg — 2015-04-06T14:03:32Z
Comment #2 by github-bugzilla — 2015-04-06T18:20:41Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/4d216e8922e94cf868a7c07ffbb1e941d5ae6060 fix Issue 14416 - .sizeof yields 1 for uninstantiated struct templates https://github.com/D-Programming-Language/dmd/commit/82623307d9cc79dc40fc044d48ef8507f15a3aea Merge pull request #4567 from 9rnsr/fix14416 Issue 14416 - .sizeof yields 1 for uninstantiated struct templates
Comment #3 by github-bugzilla — 2015-06-17T21:04:24Z