This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C++ Patch] PR 63985
- From: Jason Merrill <jason at redhat dot com>
- To: Paolo Carlini <paolo dot carlini at oracle dot com>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 22 Dec 2014 16:12:12 -0500
- Subject: Re: [C++ Patch] PR 63985
- Authentication-results: sourceware.org; auth=none
- References: <548058C1 dot 1050106 at oracle dot com> <54986928 dot 4000501 at redhat dot com> <54987ADD dot 1090309 at oracle dot com>
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