[libcxx-commits] [PATCH] D91201: [libc++] LWG2070: Use Allocator construction for objects created with allocate_shared

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Dec 17 15:05:17 PST 2020


ldionne added inline comments.


================
Comment at: libcxx/include/memory:2639
+        _LIBCPP_HIDE_FROM_ABI explicit _Storage(_Alloc&& __a) : __alloc_(_VSTD::move(__a)) { }
+        _LIBCPP_HIDE_FROM_ABI ~_Storage() { }
+        [[no_unique_address]] _Alloc __alloc_;
----------------
zoecarver wrote:
> The above comment got me thinking... why can't this be a default destructor? 
Frankly, I was getting an error about the compiler being unable to generate a destructor because the type in the union is non trivial, and this stopped the error.

I imagine the compiler is saying: you have a union with a non-trivial destructor so I want you to write your cleanup explicitly if you need some. But I could be wrong.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D91201/new/

https://reviews.llvm.org/D91201



More information about the libcxx-commits mailing list