[Issue 3667] Regression(D2 only): broken out(result) in contracts

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri May 7 11:30:40 PDT 2010


http://d.puremagic.com/issues/show_bug.cgi?id=3667



--- Comment #6 from Shin Fujishiro <rsinfu at gmail.com> 2010-05-07 11:30:35 PDT ---
Created an attachment (id=624)
Patch for DMD 2.045

The attached patch should fix the problem.

Since DMD 2.028, result variables are marked as const.  The cause of this bug
is that DMD mistakenly tries to const-fold a result variable into its default
initializer.  Unfortunately, it succeeds when return type is a basic value type
(int, bool, etc.).

The attached patch adds a STCresult storage class to declaration.h, and applies
it to the vresult.  The STCresult is similar to the STCparameter; it disables
default-value initialization of result variables.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list