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

    <tr>
        <th>Summary</th>
        <td>
            std::allocator deallocate fails to check validity of second parameter
        </td>
    </tr>

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

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

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

<pre>
    In constexpr code the following will successfully compile when it should not as it fails the precondition check of [deallocate allocator.requirements.general#48.2](http://eel.is/c++draft/allocator.requirements.general#48.2) 

```c++
  std::allocator<int> alloc;
  int* p = alloc.allocate(5);
  alloc.deallocate(p, 2);
```

https://godbolt.org/z/83M34ba9v
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyNUsGSmzAM_Rpz0ZQxNhA4cMhutjM99CMMFuCtg1nbJE2_vgKyaaa9dMZgydI8PempdfrWfJugc1OI-HP2ZGmEOCL0zlp3NdMAV2MthKXrMIR-sfZGSefZWITriBOYCGF0i9UwuQgqrA-9MjZsMLNHAtcmGkdlRux-gOuBFS8aFRXoVES4G86nHj8W4_GMUwzpgBN6ZZmQeZUKVpyYqMYYZyaPTHylg2hTE8jomHiho73qI7n_hydqYPzE-PH-L_l-7mD7K0CIei0ojw9UJl_NFJl824kz-chdn8URZmDytAfTzyaJe0Eln5L3-J8xUMbMxCuI57QHq2eq6xDCYwqD062zMXV-IO8XfZX8LvNW1ZdEN1LXslZJNNFi828v8CTDXTR3l-mirCHdbqteYRMRZuXVGSP6ZPG2-YuGiePSprQa5Fh7-by-zN69Y7fqYkJYcNWrKHN5SMZG95pjWfWq7VTWl5niecaLAg8HLDIh2sSqFm1oaF2YEBNeYYMgm7YhMY3gQvADr3iW1bxOy6w6qFb0vBJ1WciO5RzP1FS68ljnk_hmo9QuQ6CgNYHW4hFUIZhhQtzKEb5a4uh806KigehkK91s1H8DBwsFFw">