# HG changeset patch # User thomask # Date 1173371493 0 # Node ID a4faf88df9370b4e5924d3bc0a640b88c822704e # Parent f1c494dc588aab38912ce4b4e4df7975bb04a691 [Issue 979] offsetof for classes does not work Frank Benoit 2007-02-17 http://d.puremagic.com/issues/show_bug.cgi?id=979 diff -r f1c494dc588a -r a4faf88df937 run/o/offsetof_78_B.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/o/offsetof_78_B.d Thu Mar 08 16:31:33 2007 +0000 @@ -0,0 +1,26 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Frank Benoit +// @date@ 2007-02-17 +// @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=979 +// @desc@ [Issue 979] offsetof for classes does not work + +module dstress.run.o.offsetof_78_B; + +class Foo{ + int x; + + static size_t test(){ + return x.offsetof; + } +} + +int main(){ + Foo f = new Foo(); + if(f.x.offsetof != Foo.test()){ + assert(0); + } + return 0; +} diff -r f1c494dc588a -r a4faf88df937 run/o/offsetof_78_C.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/o/offsetof_78_C.d Thu Mar 08 16:31:33 2007 +0000 @@ -0,0 +1,25 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Frank Benoit +// @date@ 2007-02-17 +// @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=979 +// @desc@ [Issue 979] offsetof for classes does not work + +module dstress.run.o.offsetof_78_C; + +class Foo{ + int x; + + static size_t test(){ + return x.offsetof; + } +} + +int main(){ + if(Foo.x.offsetof != Foo.test()){ + assert(0); + } + return 0; +}