+2008-11-28 Jason Merrill <jason@redhat.com>
+
+ PR c++/38278
+ * parser.c (cp_parser_class_name): Only call
+ maybe_note_name_used_in_class if we actually found a class name.
+
2008-11-25 Jason Merrill <jason@redhat.com>
PR c++/28743
tree scope;
bool typename_p;
cp_token *token;
+ tree identifier = NULL_TREE;
/* All class-names start with an identifier. */
token = cp_lexer_peek_token (parser->lexer);
&& !cp_parser_nth_token_starts_template_argument_list_p (parser, 2))
{
cp_token *identifier_token;
- tree identifier;
bool ambiguous_p;
/* Look for the identifier. */
}
return error_mark_node;
}
- else if (decl != error_mark_node
- && !parser->scope)
- maybe_note_name_used_in_class (identifier, decl);
}
}
else
if (decl == error_mark_node)
cp_parser_error (parser, "expected class-name");
+ else if (identifier && !parser->scope)
+ maybe_note_name_used_in_class (identifier, decl);
return decl;
}