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

--- Comment #1 from Luke Dalessandro <ldalessandro at gmail dot com> ---
A short-term workaround for this appears to be explicit allocator usage (works
back at least to 10.2).

```
#include <memory>

struct Foo {
    constexpr virtual ~Foo() {}
};

constexpr bool foo() {
    std::allocator<Foo> alloc = {};

    Foo *ptr = alloc.allocate(1);
    std::construct_at(ptr);
    std::destroy_at(ptr);
    alloc.deallocate(ptr, 1);
    return true;
}

static_assert(foo());
```

https://godbolt.org/z/ohKE6h3Px

Reply via email to