Mercurial > projects > dstress
changeset 1408:a4faf88df937
[Issue 979] offsetof for classes does not work
Frank Benoit <benoit@tionex.de>
2007-02-17
http://d.puremagic.com/issues/show_bug.cgi?id=979
author | thomask |
---|---|
date | Thu, 08 Mar 2007 16:31:33 +0000 |
parents | f1c494dc588a |
children | 9f4bc2c68ce5 |
files | run/o/offsetof_78_B.d run/o/offsetof_78_C.d |
diffstat | 2 files changed, 51 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /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 <benoit@tionex.de> +// @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; +}
--- /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 <benoit@tionex.de> +// @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; +}