<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/95428>95428</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [libc++] ABI break between Clang 15 and Clang 16 for some trivially copiable pairs in C++ >= 23
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            libc++,
            ABI
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          ldionne
      </td>
    </tr>
</table>

<pre>
    ```c++
#include <type_traits>
#include <utility>

struct trivially_copyable_no_assignment {
  int arr[4];
 trivially_copyable_no_assignment& operator=(const trivially_copyable_no_assignment&) = delete;
};

static_assert(std::is_trivially_copyable<std::pair<trivially_copyable_no_assignment, int> >::value, "");

int main() { }
```

`is_trivially_copyable` was false on Clang 15 and became true on Clang 16 and above. This only affects C++23 and  C++26, which also means that we now have a different ABI between C++20 and C++23 in recent Clangs.

Godbolt: https://godbolt.org/z/hEWq59oeP
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyEU8uO6zYM_Rp6Q9xApmwnXniRx6S4uy4KdBnINh2rVaRUkhOkX1_ImTxwO8AAgh8gxXN4eKhC0EfL3EC5gXKXqSmOzjem185azlrX3xqoxP10QJt0xA7EGkhq25mpZwS5jbczH6JXOgaQH19lTFEbHW-v6PwM0U9dxOj1RStjbofOnW-qNXyw7nAnd2IbEZafsIjaRlTeQ7kpoNyBfAS-qwFUoTuzV9F5kDugVeds-B4bqAKqEeQOezYc-QkJyxf8ox0VdZcus49AqxB7kGuQax0O_8cBuX0mnJX2ScdvyWyTACA_MCk5X70oM3EKANF86l9YJcVOSlug1dzJcoOJ-j3jMdz3C1CJrwlXAq8q4KBMYHQWt0bZI-YlKttjy506MUY_vceqOaZad-EF_jHqgM6aG6ph4C4G3N49RXJOe_5WqZ_rqLsRlQkOT6xswDiqiFdG6644qgujwl4PA_tkkfXmJ7Ycr8z2WUbMVV8Y2qLnLmXP7MLivevfXN86E0GucYzxHJK6tAfaH--BhfNHoP2_QPvx489_ytrx71nfyL6Wtcq4yZf5iupiVRTZ2KxyRWWf90XdDqJW3ZBLwSUPVSHaQohlphsSVIgql3kllpQvKsqpXXa5ElwPyxVDIfiktFkYczkl7EyHMHFTlwWtMqNaNmFeWyKj28dupvlvgWi9-Zm-y13mm1TgRzsdAxTC6BDDq2TU0czL_1ai3N219Kz-fin6PunnaAfnMbh56J9ewc6ddfIKJkeHpPin_HfD7pBkNnnT_CKxjuPULjp3Atondp-vH2fv_uIuAu3n7gPQ_i7ApaH_AgAA__9oenct">