call.c (conversion_kind): New type.
* call.c (conversion_kind): New type. (conversion_rank): Likewise. (conversion): Likewise. (CONVERSION_RANK): New macro. (conversion_obstack): New variable. (obstack_initialized): Likewise. (z_candidate): Change type of convs and second_conv. (candidate_warning): New type. (IDENTITY_RANK): Remove. (EXACT_RANK): Likewise. (PROMO_RANK): Likewise. (STD_RANK): Likewise. (PBOOL_RANK): Likewise. (USER_RANK): Likewise. (ELLIPSIS_RANK): Likewise. (BAD_RANK): Likewise. (ICS_RANK): Likewise. (ICS_STD_RANK): Likewise. (ICS_USER_FLAG): Likewise. (ICS_ELLIPSIS_FLAG): Likewise. (ICS_THIS_FLAG): Likewise. (ICS_BAD_FLAG): Likewise. (NEED_TEMPORARY_P): Likewise. (CHECK_COPY_CONSTRUCTOR_P): Likewise. (USER_CONV_CAND): Likewise. (USER_CONV_FN): Likewise. (conversion_obstack_alloc): New function. (alloc_conversion): Likewise. (validate_conversion_obstack): Likewise. (alloc_conversions): Likewise. (build_conv): Adjust to deal with new conversion data structures. (build_identity_conv): New function. (build_ambiguous_conv): Likewise. (standard_conversion): Adjust to deal with new conversion data structures. (convert_class_to_reference): Likewise. (direct_reference_binding): Likewise. (reference_binding): Likewise. (implicit_conversion): Likewise. (add_candidate): Likewise. (add_function_candidate): Likewise. (add_conv_candidate): Likewise. (build_builtin_candidate): Likewise. (print_z_candidate): Likewise. (merge_conversion_sequences): Likewise. (build_user_type_conversion_1): Likewise. (build_user_type_conversion): Likewise. (build_new_function_call): Likewise. (build_object_call): Likewise. (conditional_conversion): Likewise. (build_conditional_expr): Likewise. (build_new_op): Likewise. (build_op_delete_call): Likewise. (convert_like_real): Likewise. (build_over_call): Likewise. (build_new_method_call): Likewise. (is_subseq): Likewise. (maybe_handle_implicit_object): Likewise. (maybe_handle_ref_bind): Likewise. (compare_ics): Likewise. (source_type): Likewise. (add_warning): Likewise. (joust): Likewise. (can_convert_arg): Likewise. (can_convert_arg_bad): Likewise. (perform_implicit_conversion): Likewise. (perform_direct_initialization_if_possible): Likewise. (initialize_reference): Likewise. * cp-lang.c (cp_tree_size): Do not handle WRAPPER. * cp-tree.def (WRAPPER): Likewise. (IDENTITY_CONV): Remove. (LVALUE_CONV): Likewise. (QUAL_CONV): Likewise. (STD_CONV): Likewise. (PTR_CONV): Likewise. (PMEM_CONV): Likewise. (BASE_CONV): Likewise. (REF_BIND): Likewise. (USER_CONV): Likewise. (AMBIG_CONV): Likewise. (RVALUE_CONV): Likewise. * cp-tree.h (tree_wrapper): Remove. (WRAPPER_ZC): Remove. (lang_tree_node): Remove wrapper. (LOOKUP_SPECULATIVELY): Remove. (build_op_delete_call): Adjust prototype. (validate_conversion_obstack): Declare. (build_zc_wrapper): Remove. * cvt.c (convert_to_reference): Remove dead code. (ocp_convert): Likewise. * decl.c (redeclaration_error_message): Correct handling of templates. (finish_destructor_body): Do not use LOOKUP_SPECULATIVELY. (cp_tree_node_structure): Remove WRAPPER case. * decl2.c (finish_file): Call validate_conversion_obstack. * init.c (build_new_1): Remove use of LOOKUP_SPECULATIVELY. (build_op_delete_call): Likewise. (build_x_delete): Likewise. (build_delete): Adjust call to build_op_delete_call. * pt.c (tsubst_friend_declaration): Adjust code to determine whether or not a friend template is a definition. (tsubst_decl): Clear DECL_INITIAL for new FUNCTION_DECLs. * tree.c (build_zc_wrapper): Remove. From-SVN: r77752
This commit is contained in:
parent
d349192c38
commit
5bd61841e4
11 changed files with 998 additions and 648 deletions
106
gcc/cp/ChangeLog
106
gcc/cp/ChangeLog
|
@ -1,3 +1,109 @@
|
|||
2004-02-12 Mark Mitchell <mark@codesourcery.com>
|
||||
|
||||
* call.c (conversion_kind): New type.
|
||||
(conversion_rank): Likewise.
|
||||
(conversion): Likewise.
|
||||
(CONVERSION_RANK): New macro.
|
||||
(conversion_obstack): New variable.
|
||||
(obstack_initialized): Likewise.
|
||||
(z_candidate): Change type of convs and second_conv.
|
||||
(candidate_warning): New type.
|
||||
(IDENTITY_RANK): Remove.
|
||||
(EXACT_RANK): Likewise.
|
||||
(PROMO_RANK): Likewise.
|
||||
(STD_RANK): Likewise.
|
||||
(PBOOL_RANK): Likewise.
|
||||
(USER_RANK): Likewise.
|
||||
(ELLIPSIS_RANK): Likewise.
|
||||
(BAD_RANK): Likewise.
|
||||
(ICS_RANK): Likewise.
|
||||
(ICS_STD_RANK): Likewise.
|
||||
(ICS_USER_FLAG): Likewise.
|
||||
(ICS_ELLIPSIS_FLAG): Likewise.
|
||||
(ICS_THIS_FLAG): Likewise.
|
||||
(ICS_BAD_FLAG): Likewise.
|
||||
(NEED_TEMPORARY_P): Likewise.
|
||||
(CHECK_COPY_CONSTRUCTOR_P): Likewise.
|
||||
(USER_CONV_CAND): Likewise.
|
||||
(USER_CONV_FN): Likewise.
|
||||
(conversion_obstack_alloc): New function.
|
||||
(alloc_conversion): Likewise.
|
||||
(validate_conversion_obstack): Likewise.
|
||||
(alloc_conversions): Likewise.
|
||||
(build_conv): Adjust to deal with new conversion data structures.
|
||||
(build_identity_conv): New function.
|
||||
(build_ambiguous_conv): Likewise.
|
||||
(standard_conversion): Adjust to deal with new conversion data
|
||||
structures.
|
||||
(convert_class_to_reference): Likewise.
|
||||
(direct_reference_binding): Likewise.
|
||||
(reference_binding): Likewise.
|
||||
(implicit_conversion): Likewise.
|
||||
(add_candidate): Likewise.
|
||||
(add_function_candidate): Likewise.
|
||||
(add_conv_candidate): Likewise.
|
||||
(build_builtin_candidate): Likewise.
|
||||
(print_z_candidate): Likewise.
|
||||
(merge_conversion_sequences): Likewise.
|
||||
(build_user_type_conversion_1): Likewise.
|
||||
(build_user_type_conversion): Likewise.
|
||||
(build_new_function_call): Likewise.
|
||||
(build_object_call): Likewise.
|
||||
(conditional_conversion): Likewise.
|
||||
(build_conditional_expr): Likewise.
|
||||
(build_new_op): Likewise.
|
||||
(build_op_delete_call): Likewise.
|
||||
(convert_like_real): Likewise.
|
||||
(build_over_call): Likewise.
|
||||
(build_new_method_call): Likewise.
|
||||
(is_subseq): Likewise.
|
||||
(maybe_handle_implicit_object): Likewise.
|
||||
(maybe_handle_ref_bind): Likewise.
|
||||
(compare_ics): Likewise.
|
||||
(source_type): Likewise.
|
||||
(add_warning): Likewise.
|
||||
(joust): Likewise.
|
||||
(can_convert_arg): Likewise.
|
||||
(can_convert_arg_bad): Likewise.
|
||||
(perform_implicit_conversion): Likewise.
|
||||
(perform_direct_initialization_if_possible): Likewise.
|
||||
(initialize_reference): Likewise.
|
||||
* cp-lang.c (cp_tree_size): Do not handle WRAPPER.
|
||||
* cp-tree.def (WRAPPER): Likewise.
|
||||
(IDENTITY_CONV): Remove.
|
||||
(LVALUE_CONV): Likewise.
|
||||
(QUAL_CONV): Likewise.
|
||||
(STD_CONV): Likewise.
|
||||
(PTR_CONV): Likewise.
|
||||
(PMEM_CONV): Likewise.
|
||||
(BASE_CONV): Likewise.
|
||||
(REF_BIND): Likewise.
|
||||
(USER_CONV): Likewise.
|
||||
(AMBIG_CONV): Likewise.
|
||||
(RVALUE_CONV): Likewise.
|
||||
* cp-tree.h (tree_wrapper): Remove.
|
||||
(WRAPPER_ZC): Remove.
|
||||
(lang_tree_node): Remove wrapper.
|
||||
(LOOKUP_SPECULATIVELY): Remove.
|
||||
(build_op_delete_call): Adjust prototype.
|
||||
(validate_conversion_obstack): Declare.
|
||||
(build_zc_wrapper): Remove.
|
||||
* cvt.c (convert_to_reference): Remove dead code.
|
||||
(ocp_convert): Likewise.
|
||||
* decl.c (redeclaration_error_message): Correct handling of
|
||||
templates.
|
||||
(finish_destructor_body): Do not use LOOKUP_SPECULATIVELY.
|
||||
(cp_tree_node_structure): Remove WRAPPER case.
|
||||
* decl2.c (finish_file): Call validate_conversion_obstack.
|
||||
* init.c (build_new_1): Remove use of LOOKUP_SPECULATIVELY.
|
||||
(build_op_delete_call): Likewise.
|
||||
(build_x_delete): Likewise.
|
||||
(build_delete): Adjust call to build_op_delete_call.
|
||||
* pt.c (tsubst_friend_declaration): Adjust code to determine
|
||||
whether or not a friend template is a definition.
|
||||
(tsubst_decl): Clear DECL_INITIAL for new FUNCTION_DECLs.
|
||||
* tree.c (build_zc_wrapper): Remove.
|
||||
|
||||
2004-02-12 Zack Weinberg <zack@codesourcery.com>
|
||||
|
||||
* cp-lang.c: Don't define LANG_HOOKS_BUILTIN_TYPE_DECLS.
|
||||
|
|
1404
gcc/cp/call.c
1404
gcc/cp/call.c
File diff suppressed because it is too large
Load diff
|
@ -365,7 +365,6 @@ cp_tree_size (enum tree_code code)
|
|||
case TEMPLATE_PARM_INDEX: return sizeof (template_parm_index);
|
||||
case DEFAULT_ARG: return sizeof (struct tree_default_arg);
|
||||
case OVERLOAD: return sizeof (struct tree_overload);
|
||||
case WRAPPER: return sizeof (struct tree_wrapper);
|
||||
default:
|
||||
abort ();
|
||||
}
|
||||
|
|
|
@ -217,10 +217,6 @@ DEFTREECODE (TEMPLATE_ID_EXPR, "template_id_expr", 'e', 2)
|
|||
the original name, and the parameter is the FUNCTION_DECL. */
|
||||
DEFTREECODE (OVERLOAD, "overload", 'x', 0)
|
||||
|
||||
/* A generic wrapper for something not tree that we want to include in
|
||||
tree structure. */
|
||||
DEFTREECODE (WRAPPER, "wrapper", 'x', 0)
|
||||
|
||||
/* A whole bunch of tree codes for the initial, superficial parsing of
|
||||
templates. */
|
||||
DEFTREECODE (MODOP_EXPR, "modop_expr", 'e', 3)
|
||||
|
@ -261,26 +257,6 @@ DEFTREECODE (MUST_NOT_THROW_EXPR, "must_not_throw_expr", 'e', 1)
|
|||
|
||||
DEFTREECODE (TAG_DEFN, "tag_defn", 'e', 0)
|
||||
|
||||
/* The following codes are used to represent implicit conversion
|
||||
sequences, in the sense of [over.best.ics]. The conversion
|
||||
sequences are connected through their first operands, with the
|
||||
first conversion to be performed at the end of the chain.
|
||||
|
||||
The innermost conversion (i.e, the one at the end of the chain) is
|
||||
always an IDENTITY_CONV, corresponding to the identity conversion. */
|
||||
|
||||
DEFTREECODE (IDENTITY_CONV, "identity_conv", 'e', 1)
|
||||
DEFTREECODE (LVALUE_CONV, "lvalue_conv", 'e', 1)
|
||||
DEFTREECODE (QUAL_CONV, "qual_conv", 'e', 1)
|
||||
DEFTREECODE (STD_CONV, "std_conv", 'e', 1)
|
||||
DEFTREECODE (PTR_CONV, "ptr_conv", 'e', 1)
|
||||
DEFTREECODE (PMEM_CONV, "pmem_conv", 'e', 1)
|
||||
DEFTREECODE (BASE_CONV, "base_conv", 'e', 1)
|
||||
DEFTREECODE (REF_BIND, "ref_bind", 'e', 1)
|
||||
DEFTREECODE (USER_CONV, "user_conv", 'e', 2)
|
||||
DEFTREECODE (AMBIG_CONV, "ambig_conv", 'e', 1)
|
||||
DEFTREECODE (RVALUE_CONV, "rvalue_conv", 'e', 1)
|
||||
|
||||
/*
|
||||
Local variables:
|
||||
mode:c
|
||||
|
|
|
@ -73,7 +73,6 @@ struct diagnostic_context;
|
|||
4: BINFO_NEW_VTABLE_MARKED.
|
||||
TREE_HAS_CONSTRUCTOR (in INDIRECT_REF, SAVE_EXPR, CONSTRUCTOR,
|
||||
or FIELD_DECL).
|
||||
NEED_TEMPORARY_P (in REF_BIND, BASE_CONV)
|
||||
IDENTIFIER_TYPENAME_P (in IDENTIFIER_NODE)
|
||||
5: C_IS_RESERVED_WORD (in IDENTIFIER_NODE)
|
||||
DECL_VTABLE_OR_VTT_P (in VAR_DECL)
|
||||
|
@ -346,14 +345,6 @@ struct tree_baselink GTY(())
|
|||
tree access_binfo;
|
||||
};
|
||||
|
||||
#define WRAPPER_ZC(NODE) (((struct tree_wrapper*)WRAPPER_CHECK (NODE))->z_c)
|
||||
|
||||
struct tree_wrapper GTY(())
|
||||
{
|
||||
struct tree_common common;
|
||||
struct z_candidate *z_c;
|
||||
};
|
||||
|
||||
/* The different kinds of ids that we ecounter. */
|
||||
|
||||
typedef enum cp_id_kind
|
||||
|
@ -484,7 +475,6 @@ union lang_tree_node GTY((desc ("cp_tree_node_structure (&%h)"),
|
|||
struct ptrmem_cst GTY ((tag ("TS_CP_PTRMEM"))) ptrmem;
|
||||
struct tree_overload GTY ((tag ("TS_CP_OVERLOAD"))) overload;
|
||||
struct tree_baselink GTY ((tag ("TS_CP_BASELINK"))) baselink;
|
||||
struct tree_wrapper GTY ((tag ("TS_CP_WRAPPER"))) wrapper;
|
||||
struct tree_default_arg GTY ((tag ("TS_CP_DEFAULT_ARG"))) default_arg;
|
||||
struct lang_identifier GTY ((tag ("TS_CP_IDENTIFIER"))) identifier;
|
||||
};
|
||||
|
@ -3316,9 +3306,6 @@ enum overload_flags { NO_SPECIAL = 0, DTOR_FLAG, OP_FLAG, TYPENAME_FLAG };
|
|||
direct-initialization in cases where other parts of the compiler have
|
||||
already generated a temporary, such as reference initialization and the
|
||||
catch parameter.
|
||||
LOOKUP_SPECULATIVELY means return NULL_TREE if we cannot find what we are
|
||||
after. Note, LOOKUP_COMPLAIN is checked and error messages printed
|
||||
before LOOKUP_SPECULATIVELY is checked.
|
||||
LOOKUP_NO_CONVERSION means that user-defined conversions are not
|
||||
permitted. Built-in conversions are permitted.
|
||||
LOOKUP_DESTRUCTOR means explicit call to destructor.
|
||||
|
@ -3336,7 +3323,6 @@ enum overload_flags { NO_SPECIAL = 0, DTOR_FLAG, OP_FLAG, TYPENAME_FLAG };
|
|||
#define LOOKUP_NORMAL (3)
|
||||
#define LOOKUP_NONVIRTUAL (8)
|
||||
#define LOOKUP_GLOBAL (16)
|
||||
#define LOOKUP_SPECULATIVELY (64)
|
||||
#define LOOKUP_ONLYCONVERTING (128)
|
||||
#define DIRECT_BIND (256)
|
||||
#define LOOKUP_NO_CONVERSION (512)
|
||||
|
@ -3521,7 +3507,7 @@ extern tree build_operator_new_call (tree, tree, tree *, tree *);
|
|||
extern tree build_new_method_call (tree, tree, tree, tree, int);
|
||||
extern tree build_special_member_call (tree, tree, tree, tree, int);
|
||||
extern tree build_new_op (enum tree_code, int, tree, tree, tree);
|
||||
extern tree build_op_delete_call (enum tree_code, tree, tree, int, tree);
|
||||
extern tree build_op_delete_call (enum tree_code, tree, tree, bool, tree);
|
||||
extern bool can_convert (tree, tree);
|
||||
extern bool can_convert_arg (tree, tree, tree);
|
||||
extern bool can_convert_arg_bad (tree, tree, tree);
|
||||
|
@ -3541,6 +3527,9 @@ extern tree perform_implicit_conversion (tree, tree);
|
|||
extern tree perform_direct_initialization_if_possible (tree, tree);
|
||||
extern tree in_charge_arg_for_name (tree);
|
||||
extern tree build_cxx_call (tree, tree, tree);
|
||||
#ifdef ENABLE_CHECKING
|
||||
extern void validate_conversion_obstack (void);
|
||||
#endif /* ENABLE_CHECKING */
|
||||
|
||||
/* in class.c */
|
||||
extern tree build_base_path (enum tree_code, tree, tree, int);
|
||||
|
@ -4143,7 +4132,6 @@ extern tree vec_binfo_member (tree, tree);
|
|||
extern tree decl_namespace_context (tree);
|
||||
extern tree lvalue_type (tree);
|
||||
extern tree error_type (tree);
|
||||
extern tree build_zc_wrapper (struct z_candidate *);
|
||||
extern int varargs_function_p (tree);
|
||||
extern int really_overloaded_fn (tree);
|
||||
extern bool cp_tree_equal (tree, tree);
|
||||
|
|
|
@ -552,9 +552,6 @@ convert_to_reference (tree reftype, tree expr, int convtype,
|
|||
if (flags & LOOKUP_COMPLAIN)
|
||||
error ("cannot convert type `%T' to type `%T'", intype, reftype);
|
||||
|
||||
if (flags & LOOKUP_SPECULATIVELY)
|
||||
return NULL_TREE;
|
||||
|
||||
return error_mark_node;
|
||||
}
|
||||
|
||||
|
@ -689,8 +686,6 @@ ocp_convert (tree type, tree expr, int convtype, int flags)
|
|||
return rval;
|
||||
if (flags & LOOKUP_COMPLAIN)
|
||||
error ("`%#T' used where a `%T' was expected", intype, type);
|
||||
if (flags & LOOKUP_SPECULATIVELY)
|
||||
return NULL_TREE;
|
||||
return error_mark_node;
|
||||
}
|
||||
if (code == BOOLEAN_TYPE)
|
||||
|
@ -761,8 +756,6 @@ ocp_convert (tree type, tree expr, int convtype, int flags)
|
|||
if (flags & LOOKUP_COMPLAIN)
|
||||
error ("conversion from `%T' to non-scalar type `%T' requested",
|
||||
TREE_TYPE (expr), type);
|
||||
if (flags & LOOKUP_SPECULATIVELY)
|
||||
return NULL_TREE;
|
||||
return error_mark_node;
|
||||
}
|
||||
|
||||
|
|
|
@ -2028,16 +2028,31 @@ redeclaration_error_message (tree newdecl, tree olddecl)
|
|||
}
|
||||
else if (TREE_CODE (newdecl) == TEMPLATE_DECL)
|
||||
{
|
||||
if ((TREE_CODE (DECL_TEMPLATE_RESULT (newdecl)) == FUNCTION_DECL
|
||||
&& (DECL_TEMPLATE_RESULT (newdecl)
|
||||
!= DECL_TEMPLATE_RESULT (olddecl))
|
||||
&& DECL_INITIAL (DECL_TEMPLATE_RESULT (newdecl))
|
||||
&& DECL_INITIAL (DECL_TEMPLATE_RESULT (olddecl)))
|
||||
|| (TREE_CODE (DECL_TEMPLATE_RESULT (newdecl)) == TYPE_DECL
|
||||
&& COMPLETE_TYPE_P (TREE_TYPE (newdecl))
|
||||
&& COMPLETE_TYPE_P (TREE_TYPE (olddecl))))
|
||||
tree nt, ot;
|
||||
|
||||
if (TREE_CODE (DECL_TEMPLATE_RESULT (newdecl)) == TYPE_DECL)
|
||||
{
|
||||
if (COMPLETE_TYPE_P (TREE_TYPE (newdecl))
|
||||
&& COMPLETE_TYPE_P (TREE_TYPE (olddecl)))
|
||||
return "redefinition of `%#D'";
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (TREE_CODE (DECL_TEMPLATE_RESULT (newdecl)) != FUNCTION_DECL
|
||||
|| (DECL_TEMPLATE_RESULT (newdecl)
|
||||
== DECL_TEMPLATE_RESULT (olddecl)))
|
||||
return NULL;
|
||||
|
||||
nt = DECL_TEMPLATE_RESULT (newdecl);
|
||||
if (DECL_TEMPLATE_INFO (nt))
|
||||
nt = DECL_TEMPLATE_RESULT (template_for_substitution (nt));
|
||||
ot = DECL_TEMPLATE_RESULT (olddecl);
|
||||
if (DECL_TEMPLATE_INFO (ot))
|
||||
ot = DECL_TEMPLATE_RESULT (template_for_substitution (ot));
|
||||
if (DECL_INITIAL (nt) && DECL_INITIAL (ot))
|
||||
return "redefinition of `%#D'";
|
||||
return 0;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
else if (toplevel_bindings_p () || DECL_NAMESPACE_SCOPE_P (newdecl))
|
||||
{
|
||||
|
@ -10606,8 +10621,8 @@ finish_destructor_body (void)
|
|||
be looked up in the scope of the destructor's class and if
|
||||
found shall be accessible and unambiguous. */
|
||||
exprstmt = build_op_delete_call
|
||||
(DELETE_EXPR, current_class_ptr, virtual_size,
|
||||
LOOKUP_NORMAL | LOOKUP_SPECULATIVELY, NULL_TREE);
|
||||
(DELETE_EXPR, current_class_ptr, virtual_size,
|
||||
/*global_p=*/false, NULL_TREE);
|
||||
|
||||
if_stmt = begin_if_stmt ();
|
||||
finish_if_stmt_cond (build (BIT_AND_EXPR, integer_type_node,
|
||||
|
@ -11218,7 +11233,6 @@ cp_tree_node_structure (union lang_tree_node * t)
|
|||
case TEMPLATE_PARM_INDEX: return TS_CP_TPI;
|
||||
case PTRMEM_CST: return TS_CP_PTRMEM;
|
||||
case BASELINK: return TS_CP_BASELINK;
|
||||
case WRAPPER: return TS_CP_WRAPPER;
|
||||
default: return TS_CP_GENERIC;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2884,6 +2884,10 @@ finish_file (void)
|
|||
dump_time_statistics ();
|
||||
}
|
||||
input_location = locus;
|
||||
|
||||
#ifdef ENABLE_CHECKING
|
||||
validate_conversion_obstack ();
|
||||
#endif /* ENABLE_CHECKING */
|
||||
}
|
||||
|
||||
/* FN is an OFFSET_REF, DOTSTAR_EXPR or MEMBER_REF indicating the
|
||||
|
|
|
@ -2232,15 +2232,12 @@ build_new_1 (tree exp)
|
|||
{
|
||||
enum tree_code dcode = has_array ? VEC_DELETE_EXPR : DELETE_EXPR;
|
||||
tree cleanup;
|
||||
int flags = (LOOKUP_NORMAL
|
||||
| (globally_qualified_p * LOOKUP_GLOBAL));
|
||||
|
||||
/* The Standard is unclear here, but the right thing to do
|
||||
is to use the same method for finding deallocation
|
||||
functions that we use for finding allocation functions. */
|
||||
flags |= LOOKUP_SPECULATIVELY;
|
||||
|
||||
cleanup = build_op_delete_call (dcode, alloc_node, size, flags,
|
||||
cleanup = build_op_delete_call (dcode, alloc_node, size,
|
||||
globally_qualified_p,
|
||||
(placement_allocation_fn_p
|
||||
? alloc_call : NULL_TREE));
|
||||
|
||||
|
@ -2790,9 +2787,9 @@ build_x_delete (tree addr, int which_delete, tree virtual_size)
|
|||
int use_global_delete = which_delete & 1;
|
||||
int use_vec_delete = !!(which_delete & 2);
|
||||
enum tree_code code = use_vec_delete ? VEC_DELETE_EXPR : DELETE_EXPR;
|
||||
int flags = LOOKUP_NORMAL | (use_global_delete * LOOKUP_GLOBAL);
|
||||
|
||||
return build_op_delete_call (code, addr, virtual_size, flags, NULL_TREE);
|
||||
return build_op_delete_call (code, addr, virtual_size, use_global_delete,
|
||||
NULL_TREE);
|
||||
}
|
||||
|
||||
/* Call the DTOR_KIND destructor for EXP. FLAGS are as for
|
||||
|
@ -2923,8 +2920,7 @@ build_delete (tree type, tree addr, special_function_kind auto_delete,
|
|||
return void_zero_node;
|
||||
|
||||
return build_op_delete_call
|
||||
(DELETE_EXPR, addr, cxx_sizeof_nowarn (type),
|
||||
LOOKUP_NORMAL | (use_global_delete * LOOKUP_GLOBAL),
|
||||
(DELETE_EXPR, addr, cxx_sizeof_nowarn (type), use_global_delete,
|
||||
NULL_TREE);
|
||||
}
|
||||
else
|
||||
|
@ -2959,7 +2955,7 @@ build_delete (tree type, tree addr, special_function_kind auto_delete,
|
|||
do_delete = build_op_delete_call (DELETE_EXPR,
|
||||
addr,
|
||||
cxx_sizeof_nowarn (type),
|
||||
LOOKUP_NORMAL,
|
||||
/*global_p=*/false,
|
||||
NULL_TREE);
|
||||
/* Call the complete object destructor. */
|
||||
auto_delete = sfk_complete_destructor;
|
||||
|
@ -2970,7 +2966,7 @@ build_delete (tree type, tree addr, special_function_kind auto_delete,
|
|||
/* Make sure we have access to the member op delete, even though
|
||||
we'll actually be calling it from the destructor. */
|
||||
build_op_delete_call (DELETE_EXPR, addr, cxx_sizeof_nowarn (type),
|
||||
LOOKUP_NORMAL, NULL_TREE);
|
||||
/*global_p=*/false, NULL_TREE);
|
||||
}
|
||||
|
||||
expr = build_dtor_call (build_indirect_ref (addr, NULL),
|
||||
|
|
13
gcc/cp/pt.c
13
gcc/cp/pt.c
|
@ -5009,21 +5009,20 @@ tsubst_friend_function (tree decl, tree args)
|
|||
duplicate decls since that function will free NEW_FRIEND if
|
||||
possible. */
|
||||
new_friend_template_info = DECL_TEMPLATE_INFO (new_friend);
|
||||
new_friend_is_defn =
|
||||
(DECL_INITIAL (DECL_TEMPLATE_RESULT
|
||||
(template_for_substitution (new_friend)))
|
||||
!= NULL_TREE);
|
||||
if (TREE_CODE (new_friend) == TEMPLATE_DECL)
|
||||
{
|
||||
/* This declaration is a `primary' template. */
|
||||
DECL_PRIMARY_TEMPLATE (new_friend) = new_friend;
|
||||
|
||||
new_friend_is_defn
|
||||
= DECL_INITIAL (DECL_TEMPLATE_RESULT (new_friend)) != NULL_TREE;
|
||||
new_friend_result_template_info
|
||||
= DECL_TEMPLATE_INFO (DECL_TEMPLATE_RESULT (new_friend));
|
||||
}
|
||||
else
|
||||
{
|
||||
new_friend_is_defn = DECL_INITIAL (new_friend) != NULL_TREE;
|
||||
new_friend_result_template_info = NULL_TREE;
|
||||
}
|
||||
new_friend_result_template_info = NULL_TREE;
|
||||
|
||||
/* Inside pushdecl_namespace_level, we will push into the
|
||||
current namespace. However, the friend function should go
|
||||
|
@ -6163,7 +6162,7 @@ tsubst_decl (tree t, tree args, tree type, tsubst_flags_t complain)
|
|||
/* Clear out the mangled name and RTL for the instantiation. */
|
||||
SET_DECL_ASSEMBLER_NAME (r, NULL_TREE);
|
||||
SET_DECL_RTL (r, NULL_RTX);
|
||||
|
||||
DECL_INITIAL (r) = NULL_TREE;
|
||||
DECL_CONTEXT (r) = ctx;
|
||||
|
||||
if (member && DECL_CONV_FN_P (r))
|
||||
|
|
|
@ -1641,17 +1641,6 @@ cp_tree_equal (tree t1, tree t2)
|
|||
return false;
|
||||
}
|
||||
|
||||
/* Build a wrapper around a 'struct z_candidate' so we can use it as a
|
||||
tree. */
|
||||
|
||||
tree
|
||||
build_zc_wrapper (struct z_candidate* ptr)
|
||||
{
|
||||
tree t = make_node (WRAPPER);
|
||||
WRAPPER_ZC (t) = ptr;
|
||||
return t;
|
||||
}
|
||||
|
||||
/* The type of ARG when used as an lvalue. */
|
||||
|
||||
tree
|
||||
|
|
Loading…
Add table
Reference in a new issue