184 – Cannot forward reference typedef within struct

D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 184 - Cannot forward reference typedef within struct
Summary: Cannot forward reference typedef within struct
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D1 (retired)
Hardware: x86 Windows
: P3 minor
Assignee: Walter Bright
URL:
Keywords: rejects-valid
Depends on:
Blocks:
Reported: 2006年06月08日 06:37 UTC by Matti Niemenmaa
Modified: 2014年02月15日 13:22 UTC (History)
0 users

See Also:


Attachments
Add an attachment (proposed patch, testcase, etc.)

Note You need to log in before you can comment on or make changes to this issue.
Description Matti Niemenmaa 2006年06月08日 06:37:04 UTC
struct vegetarian {
	carrots areYummy;
}
typedef ptrdiff_t carrots;
--
The above code fails to compile, producing the error "size of type ptrdiff_t is not known" twice.
Changing the typedef to an alias or placing it before the struct causes it to compile correctly.
I can't think of a good reason for why this would be an actual limitation, so I think it's a bug.
Comment 1 Walter Bright 2006年06月30日 20:28:56 UTC
Fixed DMD 0.162


AltStyle によって変換されたページ (->オリジナル) /