From: Jason Merrill Date: Thu, 5 May 2022 15:45:42 +0000 (-0400) Subject: vec: fix iterate comment X-Git-Tag: basepoints/gcc-14~7046 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e4e053a63b153039a7905901806a4f4a3154988b;p=thirdparty%2Fgcc.git vec: fix iterate comment 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. --- diff --git a/gcc/vec.h b/gcc/vec.h index 3ba7ea7edc2..eed075addc9 100644 --- a/gcc/vec.h +++ b/gcc/vec.h @@ -916,11 +916,11 @@ vec::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::iterate (v, ix, &ptr); ix++) + for (ix = 0; v->iterate (ix, &val); ix++) continue; */ template