Mercurial > projects > dstress
view run/s/struct_28_A.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 | 3da73e4504c4 |
children |
line wrap: on
line source
// $HeadURL$ // $Date$ // $Author$ // @author@ Stewart Gordon <smjg@iname.com> // @date@ 2007-02-22 // @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=997 // @desc@ [Issue 997] [Regression] Struct-returning function that conditionally passes the result of another function straight through doesn't work (NRVO bug?) module dstress.run.s.struct_28_A; struct Rect { int left, top, right, bottom; } Rect foo() { Rect result; return result; } Rect bar(){ return defaultRect(); } Rect defaultRect(){ return Rect.init; } int main() { if(foo() != bar()){ assert(0); } return 0; }