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: PATCH: PR c++/28301: [4.3/4.4/4.5 regression] ICE with broken specialization


H.J. Lu wrote:
On Tue, Mar 31, 2009 at 10:36 AM, H.J. Lu <hongjiu.lu@intel.com> wrote:
When we see an error, we shouldn't skip to the the end of block or
statement if we are already at the end of block or statement.

It seems like the problem is that most places that call cp_parser_skip_to_end_of_block_or_statement still want to see the closing brace; cp_parser_save_member_function_body is the only exception, and in that case we start with an open brace.


Would it work to do

case CPP_CLOSE_BRACE:
/* Stop if this is an unnested '}', or closes the outermost


             nesting level.  */
          nesting_depth--;
+         if (nesting_depth < 0)
+           return;
          if (!nesting_depth)
            nesting_depth = -1;
          break;

so in cases where we see a close brace without an open brace, we return without consuming it, but if we did see the open brace, we consume it and then return?

Jason


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