The AST is different in C++17 in that there is no MaterializeTemporaryExpr for in the AST for a loop variable that is initialized from an iterator that returns its elements by value.
Account for this by checking that the variable is not initialized by an operator* call that returns a value type.