[libcxx-commits] [PATCH] D121213: [libc++] Enable modernize-use-equals-delete

Eric Fiselier via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Mar 8 18:11:50 PST 2022


EricWF added a comment.



In D121213#3368882 <https://reviews.llvm.org/D121213#3368882>, @philnik wrote:

> In D121213#3368838 <https://reviews.llvm.org/D121213#3368838>, @EricWF wrote:
>
>> Are we sure this doesn't break the ABI because changing user declared constructors into delete constructors can do that, Can't it?
>
> How could it change the ABI? The functions can never be called, and it doesn't change any type traits AFAIK. It's not like with `= default` that the type could be `trivially_something` after the change that it wasn't before.

>From the Itanium C++ ABI Specification:

> non-trivial for the purposes of calls
>
> A type is considered non-trivial for the purposes of calls if:
>
> - it has a non-trivial copy constructor, move constructor, or destructor, or
> - all of its copy and move constructors are deleted.
>
> This definition, as applied to class types, is intended to be the complement of the definition in [class.temporary]p3 of types for which an extra temporary is allowed when passing or returning a type. A type which is trivial for the purposes of the ABI will be passed and returned according to the rules of the base C ABI, e.g. in registers; often this has the effect of performing a > trivial copy of the type.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D121213/new/

https://reviews.llvm.org/D121213



More information about the libcxx-commits mailing list