diff options
author | nathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-07-12 16:06:40 +0000 |
---|---|---|
committer | nathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-07-12 16:06:40 +0000 |
commit | a6460bf192e06bc6ea0613eda5cde002e65026dd (patch) | |
tree | bb13256ed44abc12331324fbb0e1e57406cd13df /gcc/cp/call.c | |
parent | 4de26b0e9e4138bcf14d675fbedbc251cf217c69 (diff) | |
download | gcc-a6460bf192e06bc6ea0613eda5cde002e65026dd.tar.gz |
* call.c (build_user_type_conversion_1, build_new_op,
check_constructor_callable, build_temp,
perform_direct_initialization_of_possible): Pass type directly to
lookup_fnfields & build_special_member_call.
(build_special_member_call): Accept a type, and complete it.
* class.c (finish_stuct_bits): Copy the BINFOs here.
* cvt.c (ocp_convert): Pass type directly to
build_special_member_call.
* decl.c (build_ptrmemfunc_type): Call xref_bastypes here.
(xref_basetypes): Allocate the binfo here. Adjust.
* init.c (build_init, build_new_1): Pass type directly to
build_special_member_call.
* lex.c (cxx_make_type): Do not allocate binfo here.
* name-lookup.c (arg_assoc_class): Incomplete types have no binfo.
* parser.c (cp_parser_class_head): Always call xref_basetypes.
* pt.c (instantiate_class_template): Likewise. Inhibit access
checking for template friends.
* ptree.c (cxx_print_type): Adjust record printing.
* search.c (lookup_base): When taking a type, complete it before
looking for a binfo.
(lookup_member): Delay completing a type.
(push_class_decls): Don't walk an incomplete type.
(lookup_conversions): Likewise.
* semantics.c (finish_stmt_expr_expr): Pass type directly to
build_special_member_call.
* tree.c (copy_base_binfos): Adjust.
(make_binfo): Likewise.
* typeck.c (build_modify_expr): Pass type directly to
build_special_member_call.
* typeck2.c (process_init_constructor): Check a binfo exists.
(build_m_component_ref): Allow accessing an incomplete type.
(build_functional_cast): Pass type directly to
build_special_member_call.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@84562 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/call.c')
-rw-r--r-- | gcc/cp/call.c | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/gcc/cp/call.c b/gcc/cp/call.c index b4f4dbbcab0..d2a17d9a7ed 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -2500,9 +2500,7 @@ build_user_type_conversion_1 (tree totype, tree expr, int flags) || !DERIVED_FROM_P (totype, fromtype), 20011226); if (IS_AGGR_TYPE (totype)) - ctors = lookup_fnfields (TYPE_BINFO (totype), - complete_ctor_identifier, - 0); + ctors = lookup_fnfields (totype, complete_ctor_identifier, 0); if (IS_AGGR_TYPE (fromtype)) conv_fns = lookup_conversions (fromtype); @@ -3650,7 +3648,7 @@ build_new_op (enum tree_code code, int flags, tree arg1, tree arg2, tree arg3, { tree fns; - fns = lookup_fnfields (TYPE_BINFO (TREE_TYPE (arg1)), fnname, 1); + fns = lookup_fnfields (TREE_TYPE (arg1), fnname, 1); if (fns == error_mark_node) { result = error_mark_node; @@ -4092,7 +4090,7 @@ check_constructor_callable (tree type, tree expr) build_special_member_call (NULL_TREE, complete_ctor_identifier, build_tree_list (NULL_TREE, expr), - TYPE_BINFO (type), + type, LOOKUP_NORMAL | LOOKUP_ONLYCONVERTING | LOOKUP_CONSTRUCTOR_CALLABLE); } @@ -4113,8 +4111,7 @@ build_temp (tree expr, tree type, int flags, expr = build_special_member_call (NULL_TREE, complete_ctor_identifier, build_tree_list (NULL_TREE, expr), - TYPE_BINFO (type), - flags); + type, flags); if (warningcount > savew) *diagnostic_fn = warning; else if (errorcount > savee) @@ -5014,6 +5011,15 @@ build_special_member_call (tree instance, tree name, tree args, || name == deleting_dtor_identifier || name == ansi_assopname (NOP_EXPR), 20020712); + if (TYPE_P (binfo)) + { + /* Resolve the name. */ + if (!complete_type_or_else (binfo, NULL_TREE)) + return error_mark_node; + + binfo = TYPE_BINFO (binfo); + } + my_friendly_assert (binfo != NULL_TREE, 20020712); class_type = BINFO_TYPE (binfo); @@ -5053,10 +5059,6 @@ build_special_member_call (tree instance, tree name, tree args, my_friendly_assert (instance != NULL_TREE, 20020712); - /* Resolve the name. */ - if (!complete_type_or_else (BINFO_TYPE (binfo), NULL_TREE)) - return error_mark_node; - fns = lookup_fnfields (binfo, name, 1); /* When making a call to a constructor or destructor for a subobject @@ -6302,8 +6304,7 @@ perform_direct_initialization_if_possible (tree type, tree expr) { expr = build_special_member_call (NULL_TREE, complete_ctor_identifier, build_tree_list (NULL_TREE, expr), - TYPE_BINFO (type), - LOOKUP_NORMAL); + type, LOOKUP_NORMAL); return build_cplus_new (type, expr); } |