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

    <tr>
        <th>Summary</th>
        <td>
            libc++: is_copy_assignable<T> gives incorrect result for containers of unique_ptr
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

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

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

<pre>
    Using libc++ from llvm-15.0.3, the result of `is_copy_assignable<T>` incorrectly says containers of `unique_ptr<T>` are copy assignable.

Example:
```cpp
#include <list>
#include <vector>
#include <memory>

int
main()
{
    // verify unique_ptr is not copy assignable
    static_assert(std::is_copy_assignable<std::unique_ptr<int>>::value == false, "");

    // so when in a vector or a list, is_copy_assignable should also be false
    static_assert(std::is_copy_assignable<std::vector<std::unique_ptr<int>>>::value == false, "");
    static_assert(std::is_copy_assignable<std::list<std::unique_ptr<int>>>::value == false, "");
}
```

Compiler errors reporting the containers are copy assignable:
```txt
<source>:10:5: error: static assertion failed due to requirement 'std::is_copy_assignable<std::vector<std::unique_ptr<int, std::default_delete<int>>, std::allocator<std::unique_ptr<int, std::default_delete<int>>>>>::value == false': 
    static_assert(
    ^
<source>:13:5: error: static assertion failed due to requirement 'std::is_copy_assignable<std::list<std::unique_ptr<int, std::default_delete<int>>, std::allocator<std::unique_ptr<int, std::default_delete<int>>>>>::value == false': 
    static_assert(
    ^
2 errors generated.
Compiler returned: 1
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzdVU1v4yAQ_TX2ZVSLQJyPgw9t0_0Fu-cIm3HCChsXcNr8-x3stE7TVNWq1R42mhDsCTPvPRimtOpY_PK63YHRZZXwOzKonW3AmENzM8szlomE30PYIzj0vQlga0gWTPttZbvjVnqvd60sDSbi_mciHsgHuq2sc1gFcwQvjx4q2wapW3T-tLxv9WOP2y64s2XSIcSgMAXNErZJ2O04PjzLpouJTs-0ZrSq605vuKDcplcIFNdoH2LoK64DgbPuA2eDjXXHyTmMug3jpCEiCV8lfH1yL-_GCdAn4T_I4IBO10eYWIL20NpwSW9a6IMMuopyogsU3gcVeYrbq0K_et_oGCES6GjRd5Cmj3w2ZFBL4zHuZML5YOtE3J3zO0PvLTztsaVtBAmjUkAmYRCUYrzHBH5ve6OAslgo8ZTuq-xedulzvn9J-QuYxkP17YiS5ebiUJ9vzr1tOm3QATpnqYgcdtaFWLexMM-q60oJvS-X8Hw6ypGH7V2FI9wZoyGn75gmTkaRYBRJ25YoEA4FikgFSzgee-2wwTYQp-X3bStp9OpUWEu6eLYKDQZ8o_L536QxtpLfFPjzTVxGeT4-TWdFlT9cV1v8G7U_PbD_o9b8pVJ2SHUhA6rsopIcht61GOHB7KJAUixmi8UiX80EY6kqhFqLtUyDDgaLqVPGpR_2QdjpA_qpFb60z5pu0rftcNIt7Z0p9iF0PmoxXMY7HfZ9mVW2oYfYlE8_N52zvyksPWrve_Q0yVf5QqT7Yq7KumJsXpYoZbUQpWDLmpc4r8tVNcdVamSJxhdJTix4i08whIg3Ur5JdcEZ5zPG50zM5vk6Y-ViyZZcKBSKKbVI5gypCZos4sis26WuGCCV_c6TMx44PzlHZRCHdBRf9mFvXaEaI90xHTIXA_I_YT-lgg">