https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95797

            Bug ID: 95797
           Summary: Can std::allocator.deallocate newed pointer during
                    constant evaluation
           Product: gcc
           Version: 10.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: johelegp at gmail dot com
  Target Milestone: ---

See https://godbolt.org/z/TxPbdC.
```C++
#include <memory>
static_assert(
    (std::allocator<int>{}.deallocate(new int[1], 1),
    true));
```
According to https://timsong-cpp.github.io/cppwp/n4861/allocator.members#6, the
argument "is a pointer value obtained from `allocate()`".

Reply via email to