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

    <tr>
        <th>Summary</th>
        <td>
            [libc++][std::allocator]
        </td>
    </tr>

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

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

    <tr>
      <th>Reporter</th>
      <td>
          sivan-shani
      </td>
    </tr>
</table>

<pre>
    According to ISO/IEC 14882:2014 under clause 17.6.3.5, 'Allocator requirements', Table 28 — 'Allocator requirements', one of the Allocator requirements is 'rebind'.

While 'libcxx/include/__memory/allocator.h' implement a rebind for the specialized void allocator, it does not implemented for the general case.

This has the effect when a custom allocator is being derived from std::allocator. 'rebind' has to be implemented in the derived class, as can be seen in this example: [godbolt](https://godbolt.org/z/rq7h8ozbY)

The first instance of a derived custom allocator works, because it is implementing 'rebind', while the second fail.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyEU02P2zYQ_TWjy2AFaySZ8kEHbxwBOfXQAEVPAUWOLLYU6ZCUd7O_vqC8ieO0QAF9HPje43vzIWM0Z8fcQ_sM7amQa5p96KO5SvcUZ-lMMXr9rT8q5YM27ozJ46fffwMaPn38gFXTdQT1kXZVg6vTHFBZuUbGSpT7si5boA8IJI7WeiWTDxj462oCL-xSBBL5_LMcLSN1CB8Juh0cmv-leMfoJ0wz43_j0MQsEng0TgOJEnYn2B1v3z9mYzkfWzOq11egwThlV81Aw5cvCy8-fAMa5HflcgYSaJaL3cRR4k0XJx82D_HCykhr3ljj1RuNP6jZrEmoPUd0Pt1F-M4-s-MgLSoZ-cHn59lEnGXcUDxNrBK-zOxQolpj8sv9npx35NwgzcFcs3rwC8akoT5CfbxneSjLTd3jyA_OjNuu_C6lrIwxJ5ERlXQZHZndDWYi8qvMZKiPCO3z2evR2wTtCaibU7rEbIEGoOH9qPThDDS8AQ3hq5g7_zb-CXR4jM44mRATGheTdGrrt7xb-jX_iw9_bx5HVtsEmpRr8iNVLs3PyTP0ZZuDrYGsfO6nNLYsdF_rQ32QBfeVoIMQYt9UxdxPaj91JJhEQ1roRvC4309TrYi5kVNdmJ521FT5rRtBVTnqZsrovZpYdGMHzY6XfIe11yVXoTAxrtxXVd3uu8LKkW3cdpEozybQ8_ZQ3s3QZ9bTuJ4jNDtrYop3nWSS3bb4J1p7gvb53xOQtdZg-19aY9K8jqXyC9CQZd9_T5fg_2KV8pJkrxFoeLd77emfAAAA__-qomH9">