[PATCH] D48753: [libcxx] Use custom allocator's `construct` in C++03 when available.

Volodymyr Sapsai via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 10 15:47:24 PDT 2018


vsapsai added a comment.

In https://reviews.llvm.org/D48753#1157907, @Quuxplusone wrote:

> In https://reviews.llvm.org/D48753#1157695, @EricWF wrote:
>
> > Why are we doing this?
> >
> > I can't find the language in the C++03 specification that requires us to call an allocators `construct` method if it's present.
>
>
> I think it's being proposed under "quality of implementation."
>
> It has only just now occurred to me: a quality implementation should probably never //mismatch// calls to `construct` and `destroy`. Does libc++ currently call `destroy` in C++03? Does it call `destroy` in C++03 after this patch?  If this patch is making libc++ call `construct` but not `destroy`, that's a bug. If before this patch libc++ would call `destroy` but not `construct`, this patch is a bugfix!  (And please add a test case for matched pairs of `construct` and `destroy`.)


In C++03 `destroy` isn't called neither before my patch nor after. Will fix that. Though it's harder to find specification for `destroy` in C++03.


https://reviews.llvm.org/D48753





More information about the cfe-commits mailing list