This is the mail archive of the
mailing list for the GCC project.
Re: [C++ PATCH] Diagnose invalid uses of auto type specifier (PR c++/37962)
- From: Jason Merrill <jason at redhat dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Mark Mitchell <mark at codesourcery dot com>, gcc-patches at gcc dot gnu dot org
- Date: Fri, 07 Nov 2008 16:25:41 -0500
- Subject: Re: [C++ PATCH] Diagnose invalid uses of auto type specifier (PR c++/37962)
- References: <20081105202741.GA3572@tyan-ft48-01.lab.bos.redhat.com>
Jakub Jelinek wrote:
(the type is error_mark_node, but due to lots of tentative parsing no error
is ever reported).
Yes, there doesn't seem to be an easy way to defer an error to the point
where we accept the parse; cp_parser_simulate_error simulates a parse
error, which this isn't, it's a semantic violation.
I would expect most of these cases to be caught by the preexisting code
that requires a complete type in these different situations. If they
aren't, that should be fixed rather than adding in new special cases for
auto everywhere. For instance, add_exception_specifier doesn't complain
because it unconditionally allows TEMPLATE_TYPE_PARM; that seems
unnecessary, and removing that if ought to fix that case.