[multiple changes]

2000-07-27  Tom Tromey  <tromey@cygnus.com>

        * parse.y (patch_method_invocation): Don't reverse the argument
        list when dealing with anonymous class constructors. Fixed typo in
        comment.

2000-07-27  Alexandre Petit-Bianco  <apbianco@cygnus.com>

        * parse.y (build_alias_initializer_parameter_list): Reverse
        crafted list when building aliases for anonymous class
        constructors.

(http://gcc.gnu.org/ml/gcc-patches/2000-07/msg01146.html)

From-SVN: r35303
This commit is contained in:
Alexandre Petit-Bianco 2000-07-27 17:30:19 -07:00
parent 7db51521a0
commit da632f2c93
3 changed files with 25 additions and 17735 deletions

View File

@ -1,3 +1,15 @@
2000-07-27 Tom Tromey <tromey@cygnus.com>
* parse.y (patch_method_invocation): Don't reverse the argument
list when dealing with anonymous class constructors. Fixed typo in
comment.
2000-07-27 Alexandre Petit-Bianco <apbianco@cygnus.com>
* parse.y (build_alias_initializer_parameter_list): Reverse
crafted list when building aliases for anonymous class
constructors.
2000-07-25 Alexandre Petit-Bianco <apbianco@cygnus.com>
* parse.y (jdep_resolve_class): Don't bother checking potential

File diff suppressed because it is too large Load Diff

View File

@ -5006,6 +5006,8 @@ build_alias_initializer_parameter_list (mode, class_type, parm, artificial)
int *artificial;
{
tree field;
tree additional_parms = NULL_TREE;
for (field = TYPE_FIELDS (class_type); field; field = TREE_CHAIN (field))
if (FIELD_LOCAL_ALIAS (field))
{
@ -5056,11 +5058,19 @@ build_alias_initializer_parameter_list (mode, class_type, parm, artificial)
}
break;
}
parm = tree_cons (purpose, value, parm);
additional_parms = tree_cons (purpose, value, additional_parms);
if (artificial)
*artificial +=1;
}
return parm;
if (additional_parms)
{
if (ANONYMOUS_CLASS_P (class_type)
&& mode == AIPL_FUNCTION_CTOR_INVOCATION)
additional_parms = nreverse (additional_parms);
parm = chainon (additional_parms, parm);
}
return parm;
}
/* Craft a constructor for CLASS_DECL -- what we should do when none
@ -9737,11 +9747,7 @@ patch_method_invocation (patch, primary, where, is_static, ret_decl)
args = build_alias_initializer_parameter_list
(AIPL_FUNCTION_CTOR_INVOCATION, DECL_CONTEXT (list), args, NULL);
/* We have to reverse things. Find out why. FIXME */
if (ANONYMOUS_CLASS_P (DECL_CONTEXT (list)))
args = nreverse (args);
/* Secretely pass the current_this/primary as a second argument */
/* Secretly pass the current_this/primary as a second argument */
if (primary || current_this)
args = tree_cons (NULL_TREE, (primary ? primary : current_this), args);
else