diff options
author | Jason Merrill <jason@redhat.com> | 2001-02-18 14:08:00 -0500 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2001-02-18 14:08:00 -0500 |
commit | e0fff4b3a7312cd08165c9a010dbafc1a4c98316 (patch) | |
tree | 78833bf4bd67d918c1690aabd6f664e5a2d426ff /gcc/cp/class.c | |
parent | 31189758710a6ea118e5f8a65aad04ea5ef968fd (diff) | |
download | gcc-e0fff4b3a7312cd08165c9a010dbafc1a4c98316.zip gcc-e0fff4b3a7312cd08165c9a010dbafc1a4c98316.tar.gz gcc-e0fff4b3a7312cd08165c9a010dbafc1a4c98316.tar.bz2 |
Do put the VTT parameter in DECL_ARGUMENTS.
* cp-tree.h (struct cp_language_function): Add x_vtt_parm.
(current_vtt_parm): New macro.
(struct lang_decl_flags): Add has_vtt_parm_p, remove vtt_parm.
(DECL_HAS_VTT_PARM_P): New macro.
(DECL_VTT_PARM): Remove.
(FUNCTION_FIRST_USER_PARMTYPE, FUNCTION_FIRST_USER_PARM): New macros.
* decl.c (duplicate_decls): Only copy the operator code if
appropriate.
(start_function): Set current_vtt_parm.
(lang_mark_tree): Don't mark vtt_parm.
* decl2.c (maybe_retrofit_in_chrg): Do add the VTT parm to
DECL_ARGUMENTS. Set DECL_HAS_VTT_PARM_P.
* class.c (build_clone): Maybe remove the VTT parm.
* optimize.c (maybe_clone_body): Set up the VTT parm.
* pt.c (copy_default_args_to_explicit_spec): Preserve the VTT parm.
* call.c (build_over_call): Just allow the VTT arg.
* method.c (make_thunk): Don't set DECL_VTT_PARM.
(do_build_copy_constructor): Use FUNCTION_FIRST_USER_PARM.
(synthesize_method): Use FUNCTION_FIRST_USER_PARMTYPE.
* decl.c (grokdeclarator, copy_args_p, grok_ctor_properties): Likewise.
* error.c (dump_function_decl): Likewise.
* call.c (build_user_type_conversion_1, convert_like_real): Abort
if we try to call a constructor with in-charge or VTT parms.
* method.c (skip_artificial_parms_for): New fn.
* call.c (add_function_candidate, build_over_call): Call it.
* call.c (build_new_method_call): Use current_vtt_parm.
* init.c (expand_virtual_init): Likewise.
* class.c (same_signature_p): No longer static.
* cp-tree.h: Declare it.
* search.c (look_for_overrides_r): Use it.
From-SVN: r39841
Diffstat (limited to 'gcc/cp/class.c')
-rw-r--r-- | gcc/cp/class.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/gcc/cp/class.c b/gcc/cp/class.c index 55bac37..7c210210 100644 --- a/gcc/cp/class.c +++ b/gcc/cp/class.c @@ -119,7 +119,6 @@ static void delete_duplicate_fields PARAMS ((tree)); static void finish_struct_bits PARAMS ((tree)); static int alter_access PARAMS ((tree, tree, tree)); static void handle_using_decl PARAMS ((tree, tree)); -static int same_signature_p PARAMS ((tree, tree)); static int strictly_overrides PARAMS ((tree, tree)); static void mark_overriders PARAMS ((tree, tree)); static void check_for_override PARAMS ((tree, tree)); @@ -2460,7 +2459,7 @@ layout_vtable_decl (binfo, n) /* True iff FNDECL and BASE_FNDECL (both non-static member functions) have the same signature. */ -static int +int same_signature_p (fndecl, base_fndecl) tree fndecl, base_fndecl; { @@ -4188,8 +4187,6 @@ build_clone (fn, name) DECL_PENDING_INLINE_P (clone) = 0; /* And it hasn't yet been deferred. */ DECL_DEFERRED_FN (clone) = 0; - /* There's no magic VTT parameter in the clone. */ - DECL_VTT_PARM (clone) = NULL_TREE; /* The base-class destructor is not virtual. */ if (name == base_dtor_identifier) @@ -4214,10 +4211,12 @@ build_clone (fn, name) parmtypes = TREE_CHAIN (parmtypes); /* Skip the in-charge parameter. */ parmtypes = TREE_CHAIN (parmtypes); + /* And the VTT parm, in a complete [cd]tor. */ + if (DECL_HAS_VTT_PARM_P (fn) + && ! DECL_NEEDS_VTT_PARM_P (clone)) + parmtypes = TREE_CHAIN (parmtypes); /* If this is subobject constructor or destructor, add the vtt parameter. */ - if (DECL_NEEDS_VTT_PARM_P (clone)) - parmtypes = hash_tree_chain (vtt_parm_type, parmtypes); TREE_TYPE (clone) = build_cplus_method_type (basetype, TREE_TYPE (TREE_TYPE (clone)), @@ -4227,8 +4226,8 @@ build_clone (fn, name) exceptions); } - /* Copy the function parameters. But, DECL_ARGUMENTS aren't - function parameters; instead, those are the template parameters. */ + /* Copy the function parameters. But, DECL_ARGUMENTS on a TEMPLATE_DECL + aren't function parameters; those are the template parameters. */ if (TREE_CODE (clone) != TEMPLATE_DECL) { DECL_ARGUMENTS (clone) = copy_list (DECL_ARGUMENTS (clone)); @@ -4239,16 +4238,17 @@ build_clone (fn, name) = TREE_CHAIN (TREE_CHAIN (DECL_ARGUMENTS (clone))); DECL_HAS_IN_CHARGE_PARM_P (clone) = 0; } - - /* Add the VTT parameter. */ - if (DECL_NEEDS_VTT_PARM_P (clone)) + /* And the VTT parm, in a complete [cd]tor. */ + if (DECL_HAS_VTT_PARM_P (fn)) { - tree parm; - - parm = build_artificial_parm (vtt_parm_identifier, - vtt_parm_type); - TREE_CHAIN (parm) = TREE_CHAIN (DECL_ARGUMENTS (clone)); - TREE_CHAIN (DECL_ARGUMENTS (clone)) = parm; + if (DECL_NEEDS_VTT_PARM_P (clone)) + DECL_HAS_VTT_PARM_P (clone) = 1; + else + { + TREE_CHAIN (DECL_ARGUMENTS (clone)) + = TREE_CHAIN (TREE_CHAIN (DECL_ARGUMENTS (clone))); + DECL_HAS_VTT_PARM_P (clone) = 0; + } } for (parms = DECL_ARGUMENTS (clone); parms; parms = TREE_CHAIN (parms)) |