]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
vec: fix iterate comment
authorJason Merrill <jason@redhat.com>
Thu, 5 May 2022 15:45:42 +0000 (11:45 -0400)
committerJason Merrill <jason@redhat.com>
Fri, 6 May 2022 20:33:58 +0000 (16:33 -0400)
The comment for this overload, which copies the value out of the vector,
was mostly describing the other overload, which stores a pointer into the
vector.

gcc/ChangeLog:

* vec.h (vec::iterate): Fix comment.

gcc/vec.h

index 3ba7ea7edc278e8f3ddc35f316b080b00206ae30..eed075addc93419aee2ad8c81daf32f3c33f5ca9 100644 (file)
--- a/gcc/vec.h
+++ b/gcc/vec.h
@@ -916,11 +916,11 @@ vec<T, A, vl_embed>::space (unsigned nelems) const
 }
 
 
-/* Return iteration condition and update PTR to point to the IX'th
+/* Return iteration condition and update *PTR to (a copy of) the IX'th
    element of this vector.  Use this to iterate over the elements of a
    vector as follows,
 
-     for (ix = 0; vec<T, A>::iterate (v, ix, &ptr); ix++)
+     for (ix = 0; v->iterate (ix, &val); ix++)
        continue;  */
 
 template<typename T, typename A>