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

    <tr>
        <th>Summary</th>
        <td>
            [libc++] atomic_unsigned_lock_free is usually signed
        </td>
    </tr>

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

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

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

<pre>
    In __atomic/aliases.h, `atomic_unsigned_lock_free` is defined as

https://github.com/llvm/llvm-project/blob/9a09c737a052dc0e2b8c15a969d16cff7ea0c133/libcxx/include/__atomic/aliases.h#L111

where `__libcpp_unsigned_lock_free` is defined as

https://github.com/llvm/llvm-project/blob/9a09c737a052dc0e2b8c15a969d16cff7ea0c133/libcxx/include/__atomic/aliases.h#L91-L107

where `__cxx_contention_t` is defined in __atomic/contention_t.h as

https://github.com/llvm/llvm-project/blob/9a09c737a052dc0e2b8c15a969d16cff7ea0c133/libcxx/include/__atomic/contention_t.h#L22-L26

Therefore, if `_LIBCPP_CONTENTION_LOCK_FREE` is true and at least one of `ATOMIC_{LLONG,INT,SHORT,CHAR}_LOCK_FREE` equals 2 (which is the case for most targets), `__libcpp_unsigned_lock_free` will be one of `int32_t` and `int64_t`, both of which are signed.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzUlE-PmzoUxT-N2VgT2Zf_CxYJGd5ELy8ZzcseGXMJbh2cYtPJ9NNXJlM1U3VUdddKCEvGPpzf9fEV1qrjgFiQeEXidSAm15ux6I79l8spaEz7UmwGWtfCmZOSBCqhlbBoFz2BkpKEXT_U0zDrtLU28mPdjYgkYVRZ2mKnBmypsIStCVte371zZ0vCJYGKQHVUrp-ahTQnApXWn78Nd-fRfEDpCFSNNg2BKhcsl2mYChZDKxlCk0keizzJW57IrktRMMnD0AuoRl4uBCo1SD21SKD6OUa45ZzfmnvucUTPVtde5Hz-u-lyfrflLH2HUF4utTSDw8EpM9TuBzD15vBvFy76P436rTuPDnC3heTW5MGTd2ZEH1_VzTXYblbl42Nd7neH-91hs9_V2335b1093d-_VsONE1IxtFQ4qlFYR82A1Mzbl4f9f5uyJulqu93v_iFQbnYHAuX_D_snP5YPyyeSrt9q4qdJaEuBEsieeyX7-S89Uiks0s6M9GSso06MR3SWQP56236RyGelNW3wxp0aXAjXU_X-rzNJNM94zca43i-9mhAj0qvuImiLsM3DXARY8JSxOE6SKAz6AkIueQxNGEVMtmmWy5ZlkEps4igW0ASqAAYh58BZFrMoXEQ8ggzTTmQxQJszEjE8CaUXPg8LMx4DZe2ERQp5kgVaNKjt3I8APC2B1fyA709jMYeomY6WREwr6-x3GaecnjvZzbZ4Td9tUb7ok52E1i-v2ME06uK3gzzbtwSqmeBrAAAA__8Ws6z1">