<div dir="ltr"><div dir="ltr">On Wed, 16 Jan 2019 at 09:10, John McCall via cfe-commits <<a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 16 Jan 2019, at 9:13, Aaron Ballman wrote:<br>
<br>
> On Wed, Jan 16, 2019 at 1:57 AM Akira Hatanaka <<a href="mailto:ahatanaka@apple.com" target="_blank">ahatanaka@apple.com</a>> <br>
> wrote:<br>
>><br>
>> Yes, the behavior of the compiler doesn’t match what’s explained <br>
>> in the documentation anymore.<br>
>><br>
>> Please take a look at the attached patch, which updates the <br>
>> documentation.<br>
><br>
> Patch mostly LGTM, but I did have one wording suggestion.<br>
><br>
>> diff --git a/include/clang/Basic/AttrDocs.td <br>
>> b/include/clang/Basic/AttrDocs.td<br>
>> index 5773a92c9c..ca3cfcf9b2 100644<br>
>> --- a/include/clang/Basic/AttrDocs.td<br>
>> +++ b/include/clang/Basic/AttrDocs.td<br>
>> @@ -2478,15 +2478,20 @@ def TrivialABIDocs : Documentation {<br>
>>    let Category = DocCatVariable;<br>
>>    let Content = [{<br>
>>  The ``trivial_abi`` attribute can be applied to a C++ class, struct, <br>
>> or union.<br>
>> -It instructs the compiler to pass and return the type using the C <br>
>> ABI for the<br>
>> +``trivial_abi`` has the following effects:<br>
>> +<br>
>> +- It instructs the compiler to pass and return the type using the C <br>
>> ABI for the<br>
>>  underlying type when the type would otherwise be considered <br>
>> non-trivial for the<br>
>>  purpose of calls.<br>
>> -A class annotated with `trivial_abi` can have non-trivial <br>
>> destructors or copy/move constructors without automatically becoming <br>
>> non-trivial for the purposes of calls. For example:<br>
>> +- It makes the destructor and copy and move constructors of the <br>
>> class trivial<br>
>> +that would otherwise be considered non-trivial under the C++ ABI <br>
>> rules.<br>
><br>
> How about: It makes the destructor, copy constructors, and move<br>
> constructors of the class trivial even if they would otherwise be<br>
> non-trivial under the C++ ABI rules.<br>
<br>
Let's not say that it makes them trivial, because it doesn't.  It causes<br>
their immediate non-triviality to be ignored for the purposes of <br>
deciding<br>
whether the type can be passed in registers.<br></blockquote><div><br></div><div>Given the attribute now forces the type to be passed in registers, I think it'd be more to the point to say that it makes the triviality of those special members be ignored when deciding whether to pass a type with a subobject of this type in registers.</div></div></div>