[Issue 2486] New: taking address of slice rvalue is valid
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue Dec 2 11:03:26 PST 2008
http://d.puremagic.com/issues/show_bug.cgi?id=2486
Summary: taking address of slice rvalue is valid
Product: D
Version: 1.037
Platform: PC
OS/Version: Linux
Status: NEW
Keywords: spec
Severity: minor
Priority: P2
Component: DMD
AssignedTo: bugzilla at digitalmars.com
ReportedBy: kamm-removethis at incasoftware.de
I was surprised to see that following compiles and generates reasonable code:
int[] a = [1, 2, 3]
auto addr = &a[0..2];
Since the frontend seems to explicitly allow it, it's probably intentional and
we've made LDC behave the same way. Could a description and rationale be added
to the spec?
--
More information about the Digitalmars-d-bugs
mailing list