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:
parent
f8ed6473e7
commit
efb169b09d
@ -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
|
||||
|
@ -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. */
|
||||
|
@ -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
|
||||
|
11
gcc/testsuite/g++.dg/parse/defarg10.C
Normal file
11
gcc/testsuite/g++.dg/parse/defarg10.C
Normal 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);
|
||||
};
|
Loading…
Reference in New Issue
Block a user