[PATCH] D41039: Add support for attribute "trivial_abi"

Akira Hatanaka via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 11 13:38:20 PST 2017


ahatanak added a comment.

I had a discussion with Duncan today and he pointed out that perhaps we shouldn't allow users to annotate a struct with "trivial_abi" if one of its subobjects is non-trivial and is not annotated with "trivial_abi" since that gives users too much power.

Should we error out or drop "trivial_abi" from struct Outer when the following code is compiled?

  struct Inner1 {
    ~Inner1(); // non-trivial
    int x;
  };
  
  struct __attribute__((trivial_abi)) Outer {
    ~Outer();
    Inner1 x;
  };

The current patch doesn't error out or drop the attribute, but the patch would probably be much simpler if we didn't allow it.


https://reviews.llvm.org/D41039





More information about the cfe-commits mailing list