[Issue 24833] enums with a base type with a copy / postblit ctor, opAssign, or dtor should either use them or be disallowed

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Nov 23 04:20:34 UTC 2024


https://issues.dlang.org/show_bug.cgi?id=24833

Jonathan M Davis <issues.dlang at jmdavisProg.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |safe

--- Comment #1 from Jonathan M Davis <issues.dlang at jmdavisProg.com> ---
I would note that this is also a memory safety issue, since it's quite possible
for the assignment operator, copy / postblit constructor, or destructor (or
move constructor once we get those) to be doing something with regards to
memory safety, and @trusted code within a type could depend on those functions
being called. For instance, skipping these functions would screw up reference
counting and potentially result in memory being freed prematurely - thus
leading to freed memory being accessed.

Related: https://issues.dlang.org/show_bug.cgi?id=24874

--


More information about the Digitalmars-d-bugs mailing list