[Issue 11428] New: A simple std.array.array call at compile-time refused
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sun Nov 3 03:31:20 PST 2013
http://d.puremagic.com/issues/show_bug.cgi?id=11428
Summary: A simple std.array.array call at compile-time refused
Product: D
Version: D2
Platform: x86
OS/Version: Windows
Status: NEW
Keywords: rejects-valid
Severity: normal
Priority: P2
Component: Phobos
AssignedTo: nobody at puremagic.com
ReportedBy: bearophile_hugs at eml.cc
--- Comment #0 from bearophile_hugs at eml.cc 2013-11-03 03:31:19 PST ---
I think this should work, I don't know if this is a regression:
import std.array: array;
const r1 = [""].array; // Error
void main() {
const r2 = [""].array; // OK
}
dmd 2.064beta4 gives:
...\dmd2\src\phobos\std\array.d(44): Error: returning a pointer to a local
stack variable
...\dmd2\src\phobos\std\array.d(48): called from here:
trustedGetAddr(result[i])
...\dmd2\src\phobos\std\array.d(48): called from here:
emplace(trustedGetAddr(result[i]), e)
test.d(2): called from here: array([""])
--
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