Bug 545 – Attempt to access a static built-in property of a deprecated struct, union, enum or typedef is not caught
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
Windows
Creation time
2006-11-17T14:04:00Z
Last change time
2014-02-15T13:18:59Z
Keywords
accepts-invalid
Assigned to
bugzilla
Creator
smjg
Comments
Comment #0 by smjg — 2006-11-17T14:04:45Z
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;
----------