Bug 21613 – DMD crash: copy ctor + templated rvalue ctor

Status
RESOLVED
Resolution
FIXED
Severity
critical
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2021-02-06T07:42:45Z
Last change time
2023-02-02T07:33:26Z
Keywords
ice, pull
Assigned to
No Owner
Creator
vitamin

Comments

Comment #0 by submada — 2021-02-06T07:42:45Z
compiler version: DMD v2.095.0 1. This code print error (that is OK): struct Test{ /////Error: struct Test may not define both a rvalue constructor and a copy constructor this(ref const typeof(this) rhs){ } this(const typeof(this) rhs){ } } void main(){ const Test cb; Test b = cb; } 2. This code crash DMD: struct Test{ this(ref const typeof(this) rhs){ } this()(const typeof(this) rhs){ ///<-- rvalue ctor is template } } void main(){ const Test cb; Test b = cb; }
Comment #1 by dlang-bot — 2022-02-18T12:27:49Z
@RazvanN7 created dlang/dmd pull request #13687 "Fix Issue 21613 - DMD crash: copy ctor + templated rvalue ctor" fixing this issue: - Fix Issue 21613 - DMD crash: copy ctor + templated rvalue ctor https://github.com/dlang/dmd/pull/13687
Comment #2 by dlang-bot — 2023-01-26T09:12:13Z
dlang/dmd pull request #13687 "Fix Issue 21613 - DMD crash: copy ctor + templated rvalue ctor" was merged into stable: - 126ccdcdcf5000d1e7c250d2a4dc5e181c79e8c9 by RazvanN7: Fix Issue 21613 - DMD crash: copy ctor + templated rvalue ctor https://github.com/dlang/dmd/pull/13687
Comment #3 by dlang-bot — 2023-02-02T07:33:26Z
dlang/dmd pull request #14857 "merge stable" was merged into master: - 353f2b6abf5893ff75ed9b531e9077215438cad9 by RazvanN7: Fix Issue 21613 - DMD crash: copy ctor + templated rvalue ctor https://github.com/dlang/dmd/pull/14857