[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
Fri Dec 18 15:11:08 PST 2020


ahatanak added a comment.

This latest patch changes the way `D` is passed in the following example, which doesn't use `trivial_abi` at all:

  struct B0 {
    int a;
    B0();
    B0(const B0 &) = default;
    B0(B0 &&) = delete;
  };
  
  struct B1 {
    int a;
    B1();
    B1(const B1 &) = delete;
    B1(B1 &&) = default;
  };
  
  struct D {
    B0 b0;
    B1 b1;
  };
  
  void testB0(B0 a) {
  }
  
  void testB1(B1 a) {
  }
  
  void testD(D a) {
  }

`D` should be passed indirectly according to the existing rules, but this patch changes that.

I think we should first clarify or decide what the rules should be when `trivial_abi` is used on a class or one of its subobjects.


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