[C++ PATCH] Diagnose invalid uses of auto type specifier (PR c++/37962)
Jason Merrill
jason@redhat.com
Sat Nov 8 00:11:00 GMT 2008
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.
Jason
More information about the Gcc-patches
mailing list