www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 979] New: offsetof for classes does not work

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=979

           Summary: offsetof for classes does not work
           Product: D
           Version: 1.005
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: benoit tionex.de


from: http://www.digitalmars.com/d/class.html
the example
class Foo
{
    int x;
}
void test(Foo foo)
{
    size_t o;

    o = Foo.x.offsetof;   // yields 8
}


t.d(12): Error: 'this' is only allowed in non-static member functions, not test
t.d(12): Error: this for x needs to be type Foo not type int


-- 
Feb 17 2007
next sibling parent Tom <tom nospam.com> writes:
Hey Frank,

   don't you think that maybe in this one, severity could be marked as 
something higher than normal?

Kind regards,
--
Tom;

d-bugmail puremagic.com escribió:
 http://d.puremagic.com/issues/show_bug.cgi?id=979
 
            Summary: offsetof for classes does not work
            Product: D
            Version: 1.005
           Platform: PC
         OS/Version: Linux
             Status: NEW
           Severity: normal
           Priority: P2
          Component: DMD
         AssignedTo: bugzilla digitalmars.com
         ReportedBy: benoit tionex.de
 
 
 from: http://www.digitalmars.com/d/class.html
 the example
 class Foo
 {
     int x;
 }
 void test(Foo foo)
 {
     size_t o;
 
     o = Foo.x.offsetof;   // yields 8
 }
 
 
 t.d(12): Error: 'this' is only allowed in non-static member functions, not test
 t.d(12): Error: this for x needs to be type Foo not type int
 
 

Feb 18 2007
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=979


benoit tionex.de changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |major




------- Comment #2 from benoit tionex.de  2007-02-19 13:14 -------
    don't you think that maybe in this one, severity could be marked as 
 something higher than normal?

Yes, i forgot about setting this. --
Feb 19 2007
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=979





------- Comment #3 from benoit tionex.de  2007-02-19 15:52 -------
But note, this works:
class Foo{
  int x;
  static void foo(){
    int o = x.offsetof; // works
  }
}


-- 
Feb 19 2007
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=979





------- Comment #4 from thomas-dloop kuehne.cn  2007-03-08 10:30 -------
Added to DStress as:
http://dstress.kuehne.cn/run/offsetof_78_B.d
http://dstress.kuehne.cn/run/offsetof_78_C.d


-- 
Mar 08 2007
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=979


thomas-dloop kuehne.cn changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         OS/Version|Linux                       |All




------- Comment #5 from thomas-dloop kuehne.cn  2007-04-27 12:31 -------
fixed URLs:
http://dstress.kuehne.cn/run/o/offsetof_78_B.d
http://dstress.kuehne.cn/run/o/offsetof_78_C.d


-- 
Apr 27 2007
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=979


onlystupidspamhere yahoo.se changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |DUPLICATE




------- Comment #6 from onlystupidspamhere yahoo.se  2007-06-17 15:52 -------
I'm marking this as a duplicate of #515. It's basically the same bug, but #515
is older and the description is a bit more precise.

*** This bug has been marked as a duplicate of 515 ***


-- 
Jun 17 2007