D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 6882 - Reference to rvalue segfaults
Summary: Reference to rvalue segfaults
Status: RESOLVED DUPLICATE of issue 4539
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86_64 Linux
: P2 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-02 08:55 UTC by jens.k.mueller
Modified: 2015-06-09 01:31 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description jens.k.mueller 2011-11-02 08:55:12 UTC
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 yebblies 2011-12-12 21:35:53 UTC

*** This issue has been marked as a duplicate of issue 4539 ***