<div dir="ltr">My bet would be: warn and ignore it, but probably Richard's & John might have stronger thoughts/justifications/etc.</div><br><div class="gmail_quote"><div dir="ltr">On Mon, Dec 11, 2017 at 1:38 PM Akira Hatanaka via Phabricator <<a href="mailto:reviews@reviews.llvm.org">reviews@reviews.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">ahatanak added a comment.<br>
<br>
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.<br>
<br>
Should we error out or drop "trivial_abi" from struct Outer when the following code is compiled?<br>
<br>
  struct Inner1 {<br>
    ~Inner1(); // non-trivial<br>
    int x;<br>
  };<br>
<br>
  struct __attribute__((trivial_abi)) Outer {<br>
    ~Outer();<br>
    Inner1 x;<br>
  };<br>
<br>
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.<br>
<br>
<br>
<a href="https://reviews.llvm.org/D41039" rel="noreferrer" target="_blank">https://reviews.llvm.org/D41039</a><br>
<br>
<br>
<br>
</blockquote></div>