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

Akira Hatanaka via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 3 16:26:07 PST 2020


ahatanak added a comment.

It seems like you are discussing the case where a class/struct annotated with `trivial_abi` contains a member that isn't destructively movable. In that case, clang correctly diagnoses it today. For example, if you remove the attribute from `S2` in the above example and add it to `S3` instead, it warns that `trivial_abi` cannot be applied to `S3` because `S2` is a non-trivial class type.

What I wasn't sure was whether `S1` (which isn't annotated with `trivial_abi` in the original code I posted) should be treated as a destructively movable type despite having all its copy/move constructors deleted when its only member (`s0`) is destructively movable.

Based on the discussion we had a few years ago (http://lists.llvm.org/pipermail/cfe-dev/2017-November/055966.html), I think the answer is yes, but I just wanted to confirm.


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