Bug 2395 – spec does not document struct forward declarations (declaring opaque struct type)

Status
RESOLVED
Resolution
WORKSFORME
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
All
Creation time
2008-10-06T07:44:00Z
Last change time
2014-02-15T13:13:19Z
Keywords
spec
Assigned to
nobody
Creator
tomas

Comments

Comment #0 by tomas — 2008-10-06T07:44:22Z
I wasn't actually aware this was valid in D: module test; struct foobar; foobar* foo() { return null; } I thought structs needed a body, I can't find anywhere this is documented as valid, did I miss it?. Also how is this supposed to play with eg. TypeInfo ? The error messages reported by DMD when trying different stuff with one aren't very descriptive.
Comment #1 by tomas — 2008-10-06T07:45:47Z
GtkD makes use of this for representing opaque (to GtkD at least) C struct types. They are never defined.
Comment #2 by bugzilla — 2012-01-22T16:41:05Z
This is now documented.