Bug 996 – Error in doc on implicit conversion between pointer and array

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dlang.org
Product
D
Version
D1 (retired)
Platform
All
OS
All
Creation time
2007-02-22T08:55:00Z
Last change time
2014-02-16T15:23:44Z
Keywords
patch, rejects-valid, spec
Assigned to
nobody
Creator
henrik
Blocks
677

Comments

Comment #0 by henrik — 2007-02-22T08:55:52Z
In the documentation on arrays, under "usage" is mentioned this sequence: int* p; int[3] s; p = s; // p points to the first element of the array s. However, this causes the following message from the compiler: "cannot implicitly convert expression (s) of type int[3] to int*." It seems the documentation needs to be updated. I only stumbled on one of the cases (the above) but there might be more cases that need revisit.
Comment #1 by gide — 2008-04-17T09:23:02Z
Comment #2 by dfj1esp02 — 2008-04-25T14:50:47Z
Bug was reported for version 1.007, but it still exists in 2.012.
Comment #3 by smjg — 2009-03-06T18:56:10Z
This bug is filed against a D1 version, so surely the URL given should be to the D1 docs. Also correcting platform and component.
Comment #4 by kamm-removethis — 2009-06-30T10:42:53Z
Marking with patch, since this fix is trivial: change p = q; p = s; p = a; to p = q; p = s.ptr; p = a.ptr;
Comment #5 by dfj1esp02 — 2009-07-02T02:12:53Z
ha-ha, the patch keyword is for bugs that have patch fixing them
Comment #6 by kamm-removethis — 2009-07-02T02:46:42Z
I honestly think it'd take longer for Walter to look at, download and apply a 'real patch' than for him to open arrays.dd and add the .ptr to lines 148/149 manually.
Comment #7 by dfj1esp02 — 2009-07-02T02:53:20Z
The same bug is in the string section: "A pointer to a char can be generated".
Comment #8 by clugdbug — 2010-06-18T12:06:23Z
Fixed in phobos commit 1663. Don't know how this one stuck around for so long.