Bug 11142 – Wrong error message "no size yet for forward reference" for opaque struct
Status
RESOLVED
Resolution
FIXED
Severity
minor
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-09-29T20:01:00Z
Last change time
2013-09-30T11:31:11Z
Keywords
diagnostic, pull
Assigned to
nobody
Creator
k.hara.pg
Comments
Comment #0 by k.hara.pg — 2013-09-29T20:01:26Z
From fail_compilation/fail91.d
struct S;
void main()
{
S* s = new S();
}
Prints:
fail_compilation/fail91.d(13): Error: struct fail91.S unknown size
fail_compilation/fail91.d(13): Error: struct fail91.S no size yet for forward reference
However, "no size yet for forward reference" is a wrong message, because opaque struct size never be calculated during compilation.
So, the code should print:
fail_compilation/fail91.d(13): Error: struct fail91.S unknown size