This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [C++ Patch] PR 63985


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]