For example: don't return a const reference to a parameter that you got as const ref. It might be a temporary (great example I send my students to is here).
But fixing just the range-based-for may lead to even more confusion.