[libcxx-commits] [PATCH] D98750: Apply [[standalone_debug]] to some types in the STL.

Amy Huang via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Mar 31 11:26:30 PDT 2021

akhuang added a comment.

In D98750#2661803 <https://reviews.llvm.org/D98750#2661803>, @ldionne wrote:

> In D98750#2660132 <https://reviews.llvm.org/D98750#2660132>, @akhuang wrote:
>> In D98750#2659984 <https://reviews.llvm.org/D98750#2659984>, @ldionne wrote:
>>> It feels like I've done that before (if so please refresh my memory), but here's a patch trying to remove the UB we have in `std::list`: https://reviews.llvm.org/D99624. Could you please try it out and see if it fixes the issues you were seeing with `__list_node`? If it does, then I believe we can apply similar fixes to the other types and fix the underlying problem instead of applying this attribute which will only hide the issue.
>> Thanks! I tried out the other patch and it does fix the issues with `__list_node`.
> Thanks for trying it out. Depending on the outcome of the discussion currently happening on D99624 <https://reviews.llvm.org/D99624>, I would suggest that we follow a similar path for the other types instead of "hiding" the issue with the attribute.
> If it is instead the case that D99624 <https://reviews.llvm.org/D99624> isn't actually fixing any UB (see discussion over there), then I believe it would be OK to move forward with this patch.
> Also, how do you reproduce the issue you're fixing here? Is there a reasonably easy way to do that so we could add something to the test suite?

Sounds good -

So, to reproduce, I've basically been building a cpp file with stuff like

  #include <list>
  std::list<int> L {1, 2, 3};
  # ..and all the other types
  int main() { return 0; }

and using gdb to pretty print the types. (or, build the obj file and look in the dwarf dump to see if the `__list_node` type is a declaration or not)

It looks like there's already a pretty printer test in libc++ (`./libcxx/test/libcxx/gdb/gdb_pretty_printer_test.sh.cpp`). It currently fails on my machine for some reason before running the actual tests, but in theory if it worked, it would catch the issues when -fuse-ctor-homing is enabled.

  rG LLVM Github Monorepo



More information about the libcxx-commits mailing list