parser.c (cp_parser_late_parsing_default_args): Fix overeager assert in previous patch.

cp:
	* parser.c (cp_parser_late_parsing_default_args): Fix overeager
	assert in previous patch.
testsuite:
	* g++.dg/parse/defarg10.C: New.

From-SVN: r100702
This commit is contained in:
Nathan Sidwell 2005-06-07 08:45:32 +00:00 committed by Nathan Sidwell
parent f8ed6473e7
commit efb169b09d
4 changed files with 24 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2005-06-07 Nathan Sidwell <nathan@codesourcery.com>
* parser.c (cp_parser_late_parsing_default_args): Fix overeager
assert in previous patch.
2005-06-06 Jakub Jelinek <jakub@redhat.com>
* error.c (locate_error): Use gmsgid instead of msgid for argument

View File

@ -15599,7 +15599,10 @@ cp_parser_late_parsing_default_args (cp_parser *parser, tree fn)
if (!default_arg)
continue;
gcc_assert (TREE_CODE (default_arg) == DEFAULT_ARG);
if (TREE_CODE (default_arg) != DEFAULT_ARG)
/* This can happen for a friend declaration for a function
already declared with default arguments. */
continue;
/* Push the saved tokens for the default argument onto the parser's
lexer stack. */

View File

@ -1,3 +1,7 @@
2005-06-07 Nathan Sidwell <nathan@codesourcery.com>
* g++.dg/parse/defarg10.C: New.
2005-06-06 Jakub Jelinek <jakub@redhat.com>
PR regression/21897

View File

@ -0,0 +1,11 @@
// Copyright (C) 2005 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 7 Jun 2005 <nathan@codesourcery.com>
// From java library.
void Foo (int = 0);
class Class
{
friend void Foo (int);
};