================
@@ -272,28 +272,109 @@ bool isUniquePtrRelease(const CXXMethodDecl &MD) {
          MD.getNumParams() == 0 && isStdUniquePtr(*MD.getParent());
 }
 
+/// Returns the set of methods that invalidate iterators for the given
+/// container, or nullptr if the container is not recognized.
+///
+/// Iterator invalidation rules per the C++ standard:
+/// https://en.cppreference.com/w/cpp/container#Iterator_invalidation
+static const llvm::StringSet<> *
+getInvalidatingMethods(StringRef ContainerName) {
+  static const llvm::StringSet<> Vector = {// Insertion
----------------
usx95 wrote:

We currently do not have a way to differentiate between iterator invalidation 
and reference invalidation.

In cases where iterators are invalidated but not references, this could be 
overly strict. This is particularly problematic for 
`UnorderedAssociative`containers. I am inclined towards keeping this less 
restrictive until we start to differentiate between iterators and interior 
references

@Xazax-hun thoughts ?

https://github.com/llvm/llvm-project/pull/183000
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to