int main() {
for (auto the_val : myCollection) {}
for (auto& the_val : myCollection) {} // issue occurs due to the & operator
for (int& the_val : myCollection) {}
}
In the markup the init and range tags are missing.
<for>for <control>(<init><decl><type><name>auto</name></type> <name>the_val</name> <range>: <expr><name>myCollection</name></expr></range></decl></init>)</control> <block>{<block_content/>}</block></for>
<for>for <control>(<init><expr><name>auto</name><operator>&</operator> <name>the_val</name> <operator>:</operator> <name>myCollection</name></expr></init>)</control> <block>{<block_content/>}</block></for>
<for>for <control>(<init><decl><type><name>int</name><modifier>&</modifier></type> <name>the_val</name> <range>: <expr><name>myCollection</name></expr></range></decl></init>)</control> <block>{<block_content/>}</block></for>