Bug 6882 – Reference to rvalue segfaults

Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2011-11-02T08:55:00Z
Last change time
2015-06-09T01:31:16Z
Assigned to
nobody
Creator
jens.k.mueller

Comments

Comment #0 by jens.k.mueller — 2011-11-02T08:55:12Z
This code unittest { void foo(ref string bar) { bar = bar[1 .. $]; } foo("test"); } segfaults with dmd v2.056 on Linux. In my understanding the problem is that "test" is an rvalue and dmd should report an compile error. I have no complete understanding regarding lvalues vs. rvalues in D.
Comment #1 by yebblies — 2011-12-12T21:35:53Z
*** This issue has been marked as a duplicate of issue 4539 ***