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 < revi...@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 > > > >
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits