[libcxx-commits] [PATCH] D99624: [libc++] Remove UB in std::list

Amy Huang via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Apr 19 11:37:58 PDT 2021


akhuang added a comment.

In D99624#2693051 <https://reviews.llvm.org/D99624#2693051>, @Quuxplusone wrote:

> @akhuang wrote:
>
>> Are there still concerns about [this patch]? IIUC the main concern is whether the original code was UB or not, which is asking whether `__list_node` is an implicit-lifetime type (or could be made to be one)?
>
> I've been persuaded that `__list_node` is not (currently) an implicit-lifetime type, and therefore the original code does have UB. (I'm still not 100% sure, but I'm no longer arguing against the premise.) I'm also not sure if it's possible to make `__list_node` an implicit-lifetime type, but again I'm willing to assume it's not possible, and therefore (1) yes there's UB, and (2) yes this is a good direction to solve it.

Ah, ok. I don't know for sure about the implicit lifetime-ness of the type either, although I assumed that it was just not a trivially constructible class. Anyway, should we get more input on this or is it good?

For context, the debug info thing that this affects currently applies to classes that are not aggregate and don't have trivial default ctors - so it's assuming that those types of classes are not implicit lifetime and need to be constructed.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D99624



More information about the libcxx-commits mailing list