[Issue 12202] New: SortedRange + alias this + foreach => Segmentation fault
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed Feb 19 05:27:13 PST 2014
https://d.puremagic.com/issues/show_bug.cgi?id=12202
Summary: SortedRange + alias this + foreach => Segmentation
fault
Product: D
Version: D2
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: tobias at pankrath.net
--- Comment #0 from Tobias Pankrath <tobias at pankrath.net> 2014-02-19 05:27:07 PST ---
--
struct S(T)
4 {
5 import std.range;
6
7 T[] data;
8
9 auto sortedRange() { return assumeSorted(data); }
10 alias sortedRange this;
11
12 }
13 unittest
14 {
15 auto a1 = S!int([1, 3,3,3, 4, 4]);
16 foreach(i, e; a1)
17 {
18
19 }
20 }
--
$ dmd -unittest -main test.d
zsh: segmentation fault (core dumped) dmd -unittest -main test.d
Both in 2.064 and ~master.
--
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list