D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 3900 - CTFE: Wrong return value for array.var assignment
Summary: CTFE: Wrong return value for array.var assignment
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D1 (retired)
Hardware: Other Windows
: P2 normal
Assignee: No Owner
URL:
Keywords: patch, rejects-valid
Depends on:
Blocks:
 
Reported: 2010-03-08 11:21 UTC by Don
Modified: 2014-04-18 09:12 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Don 2010-03-08 11:21:11 UTC
struct ArrayRet{
   int x;
}

int arrayRetTest(int z)
{
  ArrayRet[6] w;
  int q = (w[3].x = z);
  return q;  
}

static assert(arrayRetTest(51)==51);
==============

bug.d(23): Error: static assert  ([(ArrayRet(0)),(ArrayRet(0)),(ArrayRet(0)),(A
rrayRet(51)),(ArrayRet(0)),(ArrayRet(0))] == 51) is not evaluatable at compile t
ime
Comment 1 Don 2010-03-08 11:33:36 UTC
Patched in bug 3901.
Comment 2 Don 2010-04-09 19:14:05 UTC
Fixed DMD1.058 and DMD2.042.