545 – Attempt to access a static built-in property of a deprecated struct, union, enum or typedef is not caught

D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 545 - Attempt to access a static built-in property of a deprecated struct, union, enum or typedef is not caught
Summary: Attempt to access a static built-in property of a deprecated struct, union, e...
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D1 (retired)
Hardware: x86 Windows
: P2 normal
Assignee: Walter Bright
URL:
Keywords: accepts-invalid
Depends on:
Blocks:
Reported: 2006年11月17日 14:04 UTC by Stewart Gordon
Modified: 2014年02月15日 13:18 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 Stewart Gordon 2006年11月17日 14:04:45 UTC
The types defined in this code are all deprecated. However, the compiler fails to report a single error for the attempts to access static, built-in properties of these types.
For deprecated class and alias types, the compiler correctly diagnoses an error.
----------
deprecated {
	struct DepStruct {}
	union DepUnion {}
	enum DepEnum { A }
	typedef int DepTypedef;
}
const structSize = DepStruct.sizeof;
const unionSize = DepUnion.sizeof;
const enumSize = DepEnum.sizeof;
const typedefSize = DepTypedef.sizeof;
const structInit = DepStruct.init;
const unionInit = DepUnion.init;
const enumInit = DepEnum.init;
const typedefInit = DepTypedef.init;
const enumMin = DepEnum.min;
const typedefMin = DepTypedef.min;
----------
Comment 1 Walter Bright 2008年07月09日 22:34:31 UTC
Fixed dmd 1.032 and 2.016


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