[PATCH] D91744: ADT: Add assertions to SmallVector::insert, etc., for reference invalidation

Duncan P. N. Exon Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 18 16:00:37 PST 2020


dexonsmith marked an inline comment as done.
dexonsmith added inline comments.


================
Comment at: llvm/include/llvm/ADT/SmallVector.h:735
+                       T>::value,
+          bool> = true>
+  reference emplace_back(ArgType &&Arg) {
----------------
mehdi_amini wrote:
> Do you need the SFINAE and the two implementation?
> Wouldn't it always be valid to call `    this->assertSafeToAdd(&Arg);`? 
In fact we can also check for internal references in the multi-argument versions of `emplace_back`. The new patch does this... thanks!


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

https://reviews.llvm.org/D91744



More information about the llvm-commits mailing list