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

David Blaikie via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 11 14:19:00 PST 2017


My bet would be: warn and ignore it, but probably Richard's & John might
have stronger thoughts/justifications/etc.

On Mon, Dec 11, 2017 at 1:38 PM Akira Hatanaka via Phabricator <
reviews at reviews.llvm.org> wrote:

> 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
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20171211/d694963b/attachment.html>


More information about the cfe-commits mailing list