http://d.puremagic.com/issues/show_bug.cgi?id=10551
Summary: [CTFE] Wrong-code on passing dereferenced array
pointer by ref 2
Product: D
Version: D2
Platform: All
OS/Version: All
Status: NEW
Keywords: CTFE, wrong-code
Severity: major
Priority: P2
Component: DMD
AssignedTo: [email protected]
ReportedBy: [email protected]
--- Comment #0 from Denis Shelomovskij <[email protected]> 2013-07-05
21:23:12 MSD ---
Original testcase which was reduced to Issue 10243 still fails. Another reduced
testcase:
---
void f(ref ubyte n)
{ n = 1; }
void g(ubyte* p)
{ f(p[0]); }
void test()
{
ubyte[1] arr;
//f(*arr.ptr); // now works
g(arr.ptr);
assert(arr == [1]);
}
void main()
{
test();
static assert((test(), true));
}
---
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------