modernize-loop-convert handles array-like objects like vectors fairly well, but strips slightly too much information from the iteration expression by converting:
Vector<Vector<int>> X; for (int J = 0; J < X[5].size(); ++J) copyArg(X[5][J]);
to
Vector<Vector<int>> X; for (int J : X) // should be for (int J : X[5]) copyArg(J);
The [5] is a call to operator[] and gets stripped by LoopConvertCheck::getContainerString. This patch fixes that and adds several test cases.
clang-format: please reformat the code