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] Diagnose invalid uses of auto type specifier (PR c++/37962)


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]