Mercurial > projects > dstress
diff compile/s/struct_30_D.d @ 1537:457db9394771
[Issue 1204] segfault using struct in CTFE
Don Clugston <clugdbug@yahoo.com.au>
2007-04-30
http://d.puremagic.com/issues/show_bug.cgi?id=1204
author | thomask |
---|---|
date | Mon, 07 May 2007 05:21:26 +0000 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/compile/s/struct_30_D.d Mon May 07 05:21:26 2007 +0000 @@ -0,0 +1,25 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Don Clugston <clugdbug@yahoo.com.au> +// @date@ 2007-04-30 +// @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=1204 +// @desc@ [Issue 1204] segfault using struct in CTFE + +module dstress.compile.s.struct_30_D; + +struct S { + int a = 0xABCD_1234; + int b = 0xC0FF_EEEE; +} + +S foo(){ + int q = 0; + int unused; + return S(q, 0); +} + +const s = foo(); +static assert(0xABCD_1234 == s.a); +static assert(0xC0FF_EEEE == s.b);