diff options
author | Nathan Sidwell <nathan@gcc.gnu.org> | 2005-06-07 11:56:11 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@gcc.gnu.org> | 2005-06-07 11:56:11 +0000 |
commit | 01ea1ea8269ff36065e625b0b5e348568519bfa3 (patch) | |
tree | 9ba436b1b1c7d37ecfccbe0bd6d3fbbc96b13e04 /gcc/cp/parser.c | |
parent | c938250d71aa69cb46490ac49058fc1a499962e4 (diff) | |
download | gcc-01ea1ea8269ff36065e625b0b5e348568519bfa3.zip gcc-01ea1ea8269ff36065e625b0b5e348568519bfa3.tar.gz gcc-01ea1ea8269ff36065e625b0b5e348568519bfa3.tar.bz2 |
cp-tree.def (DEFAULT_ARG): Adjust documentation.
* cp-tree.def (DEFAULT_ARG): Adjust documentation.
* cp-tree.h (DEFARG_INSTANTIATIONS): New.
(struct tree_default_arg): Add instantiations member.
* parser.c (cp_parser_late_parsing_default_args): Adjust to use a
VEC.
* pt.c (tsubst_arg_types): Likewise.
From-SVN: r100707
Diffstat (limited to 'gcc/cp/parser.c')
-rw-r--r-- | gcc/cp/parser.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 23c1621..24cb027 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -12145,7 +12145,8 @@ cp_parser_parameter_declaration (cp_parser *parser, argument. */ default_argument = make_node (DEFAULT_ARG); DEFARG_TOKENS (default_argument) - = cp_token_cache_new (first_token, token); + = cp_token_cache_new (first_token, token); + DEFARG_INSTANTIATIONS (default_argument) = NULL; } /* Outside of a class definition, we can just parse the assignment-expression. */ @@ -15595,6 +15596,9 @@ cp_parser_late_parsing_default_args (cp_parser *parser, tree fn) cp_token_cache *tokens; tree default_arg = TREE_PURPOSE (parm); tree parsed_arg; + VEC(tree,gc) *insts; + tree copy; + unsigned ix; if (!default_arg) continue; @@ -15615,10 +15619,9 @@ cp_parser_late_parsing_default_args (cp_parser *parser, tree fn) TREE_PURPOSE (parm) = parsed_arg; /* Update any instantiations we've already created. */ - for (default_arg = TREE_CHAIN (default_arg); - default_arg; - default_arg = TREE_CHAIN (default_arg)) - TREE_PURPOSE (TREE_PURPOSE (default_arg)) = parsed_arg; + for (insts = DEFARG_INSTANTIATIONS (default_arg), ix = 0; + VEC_iterate (tree, insts, ix, copy); ix++) + TREE_PURPOSE (copy) = parsed_arg; /* If the token stream has not been completely used up, then there was extra junk after the end of the default |