digitalmars.D.bugs - [Issue 515] New: Spec incorrect in where .offsetof can be applied
- d-bugmail puremagic.com (32/32) Nov 15 2006 http://d.puremagic.com/issues/show_bug.cgi?id=515
- d-bugmail puremagic.com (11/11) Dec 11 2006 http://d.puremagic.com/issues/show_bug.cgi?id=515
- d-bugmail puremagic.com (8/8) Jun 17 2007 http://d.puremagic.com/issues/show_bug.cgi?id=515
- d-bugmail puremagic.com (10/10) Jun 17 2007 http://d.puremagic.com/issues/show_bug.cgi?id=515
- d-bugmail puremagic.com (12/12) Jul 02 2008 http://d.puremagic.com/issues/show_bug.cgi?id=515
- d-bugmail puremagic.com (8/8) Jul 08 2008 http://d.puremagic.com/issues/show_bug.cgi?id=515
- d-bugmail puremagic.com (12/12) Jul 09 2008 http://d.puremagic.com/issues/show_bug.cgi?id=515
- d-bugmail puremagic.com (4/4) Jul 09 2008 http://d.puremagic.com/issues/show_bug.cgi?id=515
http://d.puremagic.com/issues/show_bug.cgi?id=515 Summary: Spec incorrect in where .offsetof can be applied Product: D Version: 0.174 Platform: PC URL: http://www.digitalmars.com/d/class.html OS/Version: Windows Status: NEW Keywords: spec Severity: normal Priority: P4 Component: DMD AssignedTo: bugzilla digitalmars.com ReportedBy: deewiant gmail.com OtherBugsDependingO 511 nThis: The spec has code amounting to the following, under "Field Properties": class Foo { int x; } void main() { Foo foo = new Foo(); size_t o; o = Foo.x.offsetof; o = foo.x.offsetof; } The spec states that the above of the two assignments to o should yield 8 and the below should fail to compile. DMD's behaviour is precisely the opposite. The explanation confused me somewhere around "fields qualified with the type of the class" so I'm not sure which is right, but one of the two - the spec, or DMD - has to be wrong. --
Nov 15 2006
http://d.puremagic.com/issues/show_bug.cgi?id=515 smjg iname.com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |smjg iname.com Keywords| |accepts-invalid, rejects- | |valid The spec makes more sense than what the compiler is doing. I'm therefore inclined that DMD is wrong. --
Dec 11 2006
http://d.puremagic.com/issues/show_bug.cgi?id=515 onlystupidspamhere yahoo.se changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |benoit tionex.de *** Bug 979 has been marked as a duplicate of this bug. *** --
Jun 17 2007
http://d.puremagic.com/issues/show_bug.cgi?id=515 onlystupidspamhere yahoo.se changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|normal |major OS/Version|Windows |All Priority|P4 |P2 --
Jun 17 2007
http://d.puremagic.com/issues/show_bug.cgi?id=515 Just a ping that the spec (http://www.digitalmars.com/d/1.0/class.html) is still not in line with the compiler (DMD 1.031). You can see it first mentioned regarding DMD 0.131 back in 2005 here: http://www.digitalmars.com/d/archives/digitalmars/D/bugs/4988.html Just to recap: In the compiler Foo.init.x.offsetof works. Foo.x.offsetof does not. Spec says the opposite is true. --
Jul 02 2008
http://d.puremagic.com/issues/show_bug.cgi?id=515 davidl 126.com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |samukha voliacable.com *** Bug 2202 has been marked as a duplicate of this bug. *** --
Jul 08 2008
http://d.puremagic.com/issues/show_bug.cgi?id=515 wbaxter gmail.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED There's a typo in the updated doc now: ".offsetof can only be applied to not expressions" I'll file a different bug though. This basic issue of this bug has been fixed by changing the spec. --
Jul 09 2008
http://d.puremagic.com/issues/show_bug.cgi?id=515 Fixed dmd 1.032 and 2.016 --
Jul 09 2008