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


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.
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.  :)
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.

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]