Bug 12766 – Forward reference diagnostics must emit the offending line causing the forward reference
Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-05-18T17:57:29Z
Last change time
2022-08-22T15:48:08Z
Keywords
diagnostic
Assigned to
No Owner
Creator
Andrej Mitrovic
Comments
Comment #0 by andrej.mitrovich — 2014-05-18T17:57:29Z
-----
struct A
{
B b; // L3
}
struct B // L6
{
A a; // L8
}
void main() { }
-----
$ test.d(6): Error: struct test.B no size yet for forward reference
This is a completely useless diagnostic, it doesn't tell me *what code* caused the forward reference. It should either reference L3 or L8, not the line of the beginning of the struct definition.
Comment #1 by razvan.nitu1305 — 2022-08-22T15:48:08Z
This now issues:
test.d(8): Error: struct `test.A` no size because of forward reference
So, I guess this has been fixed.