[Bug c++/98840] Why does baz call the delete operator for moved unique_ptr

dmitriy.ovdienko at gmail dot com gcc-bugzilla@gcc.gnu.org
Tue Jan 26 21:03:20 GMT 2021


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98840

--- Comment #4 from Dmitriy Ovdienko <dmitriy.ovdienko at gmail dot com> ---
What if introduce new ABI version and encode into function name (function name
mangling). 

And then have two options:

* Either compile code and store both versions into lib file (ABI v1 and v2).
Applies only to functions that have arguments of the non-trivial class passed
by value.
* Or compile ABI v2 and then linker if can find referenced ABI v2 function uses
it as is (assuming that v2 function destructs the object inside) or if v2
function is not found it calls v1 function and adds the code to destruct
objects passed by value.

That applies to destruction only. Stack is cleaned by calling function as
before.


More information about the Gcc-bugs mailing list