2004-02-03 Mark Mitchell <mark@codesourcery.com>
+ PR c++/13950
+ * parser.c (cp_parser_class_name): Robustify.
+
+ PR c++/13970
+ * parser.c (cp_parser_cache_group): Do not consume the EOF token.
+
PR c++/14002
* semantics.c (finish_id_expression): Do not return an
IDENTIFIER_NODE when lookup finds a PARM_DECL.
/* If this is a typename, create a TYPENAME_TYPE. */
if (typename_p && decl != error_mark_node)
- decl = TYPE_NAME (make_typename_type (scope, decl,
- /*complain=*/1));
+ {
+ decl = make_typename_type (scope, decl, /*complain=*/1);
+ if (decl != error_mark_node)
+ decl = TYPE_NAME (decl);
+ }
/* Check to see that it is really the name of a class. */
if (TREE_CODE (decl) == TEMPLATE_ID_EXPR
if ((end == CPP_CLOSE_PAREN || depth == 0)
&& cp_lexer_next_token_is (parser->lexer, CPP_SEMICOLON))
return;
- /* Consume the next token. */
- token = cp_lexer_consume_token (parser->lexer);
/* If we've reached the end of the file, stop. */
- if (token->type == CPP_EOF)
+ if (cp_lexer_next_token_is (parser->lexer, CPP_EOF))
return;
+ /* Consume the next token. */
+ token = cp_lexer_consume_token (parser->lexer);
/* Add this token to the tokens we are saving. */
cp_token_cache_push_token (cache, token);
/* See if it starts a new group. */
2004-02-03 Mark Mitchell <mark@codesourcery.com>
+ PR c++/13950
+ * g++.dg/template/lookup4.C: New test.
+
+ PR c++/13970
+ * g++.dg/parse/error14.C: New test.
+
PR c++/14002
* g++.dg/parse/template13.C: New test.