[Issue 979] New: offsetof for classes does not work
Tom
tom at nospam.com
Sun Feb 18 18:49:26 PST 2007
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 at 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 at digitalmars.com
> ReportedBy: benoit at 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
>
>
More information about the Digitalmars-d-bugs
mailing list