Bug 21735 – [REG 2.093.1] Compiler segfaults when using a struct with a copy constructor in an array

Status
RESOLVED
Resolution
WORKSFORME
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2021-03-19T16:55:01Z
Last change time
2021-03-19T17:36:18Z
Assigned to
No Owner
Creator
wolframw

Comments

Comment #0 by wolframw — 2021-03-19T16:55:01Z
``` void main() { import std.stdio : writeln; struct Foo { int i = 5; this(ref return scope Foo rhs) { } } Foo[1] foo; writeln("foo: ", foo); } ``` This crashes the compiler since version 2.093.1. It does not matter whether a static array or a dynamic array is used.
Comment #1 by moonlightsentinel — 2021-03-19T17:36:18Z
DMD doesn't crash with current master (> 2.096.0)