I fixed Clang-tidy modernize-loop-convert and modernize-use-auto. Autos are also used for pointer variables assigned via casts. Patch includes other minor cleanups.
Fixes are in both source and generated code.
Build and regressions were finr on RHEL 6.
I don't think this is the correct change (a const std::foo<bar>::iterator is often different than a std::foo<bar>::const_iterator). I would drop the const since the original is an iterator instead of a const_iterator anyway.