On 12/22/2014 03:11 PM, Paolo Carlini wrote:
That would be the place. But, at that point, it could still be a normal
for loop, thus we can't just give an error.

Ah, yes.

Assigning error_mark_node on
the other hand is correct, because later, if we find the colon, we
realize that the declaration is wrong because has an initializer.

We could also peek for a colon in cp_parser_init_declarator after parsing the initializer, and give an error then.

For
the record, clang vs edg appear to handle this case differently: clang
considers it a wrong for loop, edg a wrong range-based for loop. Humm...

They're both right.  :)

Jason

Reply via email to