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] |
Hello,I'm a little nervous about this because if it turned out that this was something other than a template-id, then issuing the error would be wrong. But, it looks like that can't happen.
the parser accepts invalid code such as: ---------------------------------------------------------- template <int> struct A {}; template <typename TP> class B : public A<4 {}; // missing bracket! ----------------------------------------------------------
This happens because the check is done by cp_parser_require, which does not emit an error during tentative parsing. The argument list is not invalidated by this, and a CPP_TEMPLATE_ID is created, so that subsequent (non-tentative) parsings fail to diagnose the problem. Fixed by forcing a hard error.
Tested on i686-pc-linux-gnu, OK for mainline and 3.4?
-- Mark Mitchell CodeSourcery, LLC (916) 791-8304 mark@codesourcery.com
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |