[libcxx-commits] [libcxx] [libc++] Tweak how we check constraints on shared_ptr(nullptr_t) (PR #94996)

via libcxx-commits libcxx-commits at lists.llvm.org
Wed Jun 12 10:42:38 PDT 2024


alexfh wrote:

Apparently, people rely on `std::shared_ptr<std::nullptr_t>`, which stops working after this patch: https://gcc.godbolt.org/z/7zrqKT74v

```
#include <functional>
#include <memory>

void f(const std::function<void()>& deleter) {
    auto d = std::shared_ptr<std::nullptr_t>(
          nullptr, [deleter](std::nullptr_t) { deleter(); });
}
```

Do you know if `std::shared_ptr<std::nullptr_t>` should work by the standard?

https://github.com/llvm/llvm-project/pull/94996


More information about the libcxx-commits mailing list