digitalmars.D.bugs - [Issue 5350] New: .tupleof lists members of nested anonymous union as members of containing struct
- d-bugmail puremagic.com (42/42) Dec 14 2010 http://d.puremagic.com/issues/show_bug.cgi?id=5350
- d-bugmail puremagic.com (13/13) Dec 19 2010 http://d.puremagic.com/issues/show_bug.cgi?id=5350
http://d.puremagic.com/issues/show_bug.cgi?id=5350 Summary: .tupleof lists members of nested anonymous union as members of containing struct Product: D Version: D2 Platform: Other OS/Version: Windows Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: nobody puremagic.com ReportedBy: elfy.nv gmail.com struct S2 { int type; union { int i; string s; } } void main() { S2 s2; foreach (i, Subobj; typeof(s2.tupleof)) { writeln(s2.tupleof[i].stringof); } } output: --- s2.type s2.i s2.s --- This in turn leads to wrong behaviour of std.exception.pointsTo, which tries every member of union (read: all kind of invalid pointers) without any clue that they are actually part of nested union. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Dec 14 2010
http://d.puremagic.com/issues/show_bug.cgi?id=5350 Walter Bright <bugzilla digitalmars.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |bugzilla digitalmars.com Resolution| |INVALID 22:01:03 PST --- All anonymous unions do is control the layout. The fields *are* part of the enclosing struct's fields. This is as designed. Not a bug. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Dec 19 2010