[PATCH] D92361: [trivial-abi] Support types without a copy or move constructor.

John McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 1 18:34:50 PST 2020


rjmccall added a comment.

That's an excellent example to study.  The fundamental question we are looking to answer is whether a type representationally depends on its address.  Absent the `trivial_abi` attribute, the criterion for knowing that it does not is whether it is possible to copy or move it trivially.  If it is not possible to copy or move the type at all, it is not possible to copy or move it trivially.  So `S0` may representationally depend on its address, and we should ignore/diagnose `trivial_abi` on aggregates containing an `S0`.

Similarly, if a subobject type has only non-trivial copy/move constructors (but a trivial destructor), we should assume that it representationally depends on its address and prevent aggregates containing it from being passed directly, even if the containing type deletes all its copy/move constructors and uses `trivial_abi`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D92361



More information about the cfe-commits mailing list