[PATCH] D84293: Add an assertion in SmallVector::push_back()

Nathan James via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 13 15:09:50 PST 2020


njames93 added a comment.

This assert should probably also be used (albeit some in a modified way) for:

- `resize(size_type, const T&)`
- `append(size_type, const T&)`
- `insert(iterator, const T&)`
- `insert(iterator, T &&)`
- `insert(iterator, size_type, const T&)`

As all these functions can grow and invalidate the reference.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D84293



More information about the llvm-commits mailing list