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

Amy Huang via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Apr 27 15:58:43 PDT 2021


akhuang added a comment.

Seems like it's a little less straightforward for some of the other types (`__tree_node`, `__value_type` and `__hash_value_type`), especially since they explicitly delete the constructors/destructors and I don't have a great understanding of why. Should probably get @EricWF's opinion on this?

I'm still somewhat leaning toward just adding an attribute to those types to solve the debug info issue (https://reviews.llvm.org/D98750)



================
Comment at: libcxx/include/list:282-285
+#ifndef _LIBCPP_CXX03_LANG
+    _LIBCPP_INLINE_VISIBILITY
+    __list_node() {}
+#endif
----------------
Quuxplusone wrote:
> Any reason not to `=default` this constructor? (And I'd make it `explicit`, since there's no reason not to, and it might ease overload resolution just a tiny bit. In my codebases, the `explicit` keyword basically means "Look out, here comes a constructor!")
apparently using `=default` complains because `__value_` doesn't have a default constructor


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D101206



More information about the libcxx-commits mailing list