[PATCH] Fix PR c++/31745: ICE on invalid use of namespace

Mark Mitchell mark@codesourcery.com
Mon May 21 20:07:00 GMT 2007


Simon Martin wrote:
> Hi all.
> 
> I attach an updated patch, that uses 'cp_lexer_next_token_is (...,
> CPP_CLOSE_BRACE)' instead of 'cp_lexer_next_token_is_not (..., CPP_EOF)'
> as suggested by Manuel, and that also fixes the other testcase that
> triggers a similar ICE in another part of the code, contributed by Lee.

This version is OK -- though I think that Manuel is correct that
updating cp_parser_skip_to_closing_brace to return the next token type,
or a boolean indicating whether it found a closing brace, is a nice
idea, just in making the code a little simpler.

Thanks,

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713



More information about the Gcc-patches mailing list