D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 2395 - spec does not document struct forward declarations (declaring opaque struct type)
Summary: spec does not document struct forward declarations (declaring opaque struct t...
Status: RESOLVED WORKSFORME
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D1 (retired)
Hardware: x86 All
: P2 normal
Assignee: No Owner
URL:
Keywords: spec
Depends on:
Blocks:
 
Reported: 2008-10-06 07:44 UTC by Tomas Lindquist Olsen
Modified: 2014-02-15 13:13 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Tomas Lindquist Olsen 2008-10-06 07:44:22 UTC
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 Tomas Lindquist Olsen 2008-10-06 07:45:47 UTC
GtkD makes use of this for representing opaque (to GtkD at least) C struct types. They are never defined.
Comment 2 Walter Bright 2012-01-22 16:41:05 UTC
This is now documented.