[PATCH] D93779: ADT: Fix reference invalidation in SmallVector::push_back and single-element insert

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 14 09:02:50 PST 2021


dblaikie added a comment.

In D93779#2498501 <https://reviews.llvm.org/D93779#2498501>, @lebedev.ri wrote:

> Why do we even want to bend over backwards and try to handle broken code correctly,
> at the cost of regressed performance for everything,
> instead of just adding defensive asserts against such problems,
> and letting/telling the user fix the code?

I believe the standard library supports this, so I think it's a somewhat awkward limitation to have a standard-library-like container that misses that. (of course the small-mode isn't entirely compatible with std::vector, etc anyway - so some divergence is possible)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D93779



More information about the llvm-commits mailing list