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: [RFA] PATCH for PR c++/39639


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jason Merrill a Ãcrit :
> Why aren't we getting an error from cp_parser_template_argument?

That function tentatively tries to parse the different kinds of template
arguments (type or non-type arguments), doesn't find any of those, rolls back
the tentative parse (by calling cp_parser_parse_definitely) and returns the
argument it found - which in this case is error_mark_node as no argument were found.

The last call to cp_parser_parse_definitely discarded the errors that occurred
during the tentative parsing.

I thought about making cp_parser_template_argument spit an error when no
argument were parsed and the next token was an ellipsis, but then I wasn't sure
why the ellipsis detection and pack expansion weren't done in that function in
the first place; those are done in cp_parser_template_argument_list. So I
thought I should handle the error at the level of
cp_parser_template_argument_list as well.

Thanks.

D.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Remi - http://enigmail.mozdev.org

iEYEARECAAYFAknfLaAACgkQPejI7lrem2H3WgCglvoupkd2MxZhpUKZzOAwACLJ
GxMAoJQLJCNrNGla9IwSlX44IhiD6cdK
=gIrF
-----END PGP SIGNATURE-----


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