Bug 19902 – hasElaborateCopyConstructor doesn't know about copy constructors
Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
druntime
Product
D
Version
D2
Platform
All
OS
All
Creation time
2019-05-25T20:44:11Z
Last change time
2020-01-20T03:50:22Z
Keywords
pull
Assigned to
Eduard Staniloiu
Creator
Manu
Comments
Comment #0 by turkeyman — 2019-05-25T20:44:11Z
`hasElaborateCopyConstructor` in phobos (and also in druntime: core.internal.traits) needs to be updated to understand copy constructors.
There may be some others that need tweaking too?
Comment #1 by issues.dlang — 2019-06-02T19:35:57Z
Indeed. Without it being updated, any existing code that's testing for whether it's okay to blit a type is broken when dealing with structs that have copy constructors (e.g. I expect that std.algorithm's swap is currently broken in such a fashion). I don't know if there's code that would break because it's really assuming postblit constructors from hasElaborateCopyConstructor rather than the inability to blit, but I expect that more code will be broken without updating the trait than with requiring a new one. Also, there's already been at least one post in D.Learn where someone was confused, because hasElaborateCopyConstructor wasn't true for types with copy constructors.
Comment #2 by turkeyman — 2019-06-30T04:36:01Z
This is a very critical issue.
Comment #3 by dlang-bot — 2019-07-31T12:09:04Z
@edi33416 created dlang/druntime pull request #2709 "Fix Issue 19902 - hasElaborateCopyConstructor doesn't know about copy…" fixing this issue:
- Fix Issue 19902 - hasElaborateCopyConstructor doesn't know about copy constructors
https://github.com/dlang/druntime/pull/2709
Comment #4 by dlang-bot — 2020-01-19T19:55:20Z
@pbackus created dlang/druntime pull request #2911 "Fix issue 19902 - hasElaborateCopyConstructor doesn't know about copy…" fixing this issue:
- Fix issue 19902 - hasElaborateCopyConstructor doesn't know about copy constructors
https://github.com/dlang/druntime/pull/2911
Comment #5 by dlang-bot — 2020-01-20T03:50:22Z
dlang/druntime pull request #2911 "Fix issue 19902 - hasElaborateCopyConstructor doesn't know about copy…" was merged into stable:
- 0c3fd57891f7ee6fa65b57bc2011f301017399e4 by Paul Backus:
Fix issue 19902 - hasElaborateCopyConstructor doesn't know about copy constructors
https://github.com/dlang/druntime/pull/2911