D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 947 - offsetof and alignof for an enum field of a struct fail to compile
Summary: offsetof and alignof for an enum field of a struct fail to compile
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D1 (retired)
Hardware: All All
: P2 normal
Assignee: No Owner
URL:
Keywords: rejects-valid
Depends on:
Blocks:
 
Reported: 2007-02-11 01:44 UTC by Mark Guidarelli
Modified: 2014-02-16 15:21 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Mark Guidarelli 2007-02-11 01:44:15 UTC
// dbug.d:15: Error: no property 'offsetof' for type 'int'

enum magic {
	xyzzy,
	plugh
}

struct plover {
	int a;
	magic b;
	int c;
}

void main() {
	auto y2 = plover.b.offsetof;
}
Comment 1 Thomas Kühne 2007-03-29 14:30:32 UTC
Added to DStress as
http://dstress.kuehne.cn/compile/o/offsetof_81_A.d
Comment 2 Don 2009-09-10 05:17:59 UTC
This was fixed either in 1.039 or 1.041. Works in D2, as well.