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] |
Hi, On 12/22/2014 10:12 PM, Jason Merrill wrote:
We could also peek for a colon in cp_parser_init_declarator after parsing the initializer, and give an error then.
I see.
Well, if they are both right, could we maybe do something closer to clang, instead, thus not consider the for loop a range-based for loop only because after the initializer there is a colon when the decl is error_mark_node? As an heuristics I think it may make sense in these borderline cases because the declarator is more restricted for a range-based. The below passes testing.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. :)
Thanks, Paolo. /////////////
Attachment:
patch_63985_3
Description: Text document
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |