diff options
author | Nathan Sidwell <nathan@codesourcery.com> | 2004-08-30 15:28:48 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@codesourcery.com> | 2004-08-30 15:28:48 +0000 |
commit | 6133a6a4afdc9136aa022347717787ab6c55cd52 (patch) | |
tree | 4ca6b4e112f696c8ceed5ba25d4dd59e1b129aba /gcc/cp/init.c | |
parent | f0e3b10841221de20745ddebd0e588bc1e1a0a40 (diff) |
* call.c (check_dtor_name): Replace abort with gcc_assert or
gcc_unreachable.
(build_call, add_builtin_candidate, build_new_op,
convert_like_real, build_over_call, in_charge_arg_for_name,
source_type, joust): Likewise.
* class.c (build_simple_base_path, get_vcall_index,
finish_struct_1, instantiate_type, get_enclosing_class,
add_vcall_offset_vtbl_entries_1, cp_fold_obj_type_ref): Likewise.
* cp-gimplify.c (cp_genericize): Likewise.
* cp-lang.c (cp_expr_size, cp_tree_size): Likewise.
* cvt.c (cp_convert_to_pointer, ocp_convert): Likewise.
* decl.c (poplevel, make_unbound_class_template, reshape_init,
check_special_function_return_type, grokdeclarator,
grok_op_properties, tag_name, xref_tag, start_preparsed_function,
finish_function): Likewise.
* decl2.c (grokfield, maybe_emit_vtables):Likewise.
* error.c (dump_global_iord, dump_decl, dump_template_decl,
language_to_string): Likewise.
* except.c (choose_personality_routine): Likewise.
* friend.c (do_friend): Likewise.
* g++spec.c (lang_specific_driver): Likewise.
* init.c (build_zero_init, expand_default_init, build_new_1,
build_vec_delete_1, build_vec_init, build_dtor_call): Likewise.
* lex.c (retrofit_lang_decl, cp_type_qual_from_rid): Likewise.
* mangle.c (add_substitution, write_unscoped_name,
write_template_prefix, write_identifier,
write_special_name_destructor, write_type, write_builtin_type,
write_expression, write_template_param,
write_java_integer_type_codes): Likewise.
* method.c (implicitly_declare_fn): Likewise.
git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@86778 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/init.c')
-rw-r--r-- | gcc/cp/init.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/gcc/cp/init.c b/gcc/cp/init.c index ea38333d776..01478818b27 100644 --- a/gcc/cp/init.c +++ b/gcc/cp/init.c @@ -240,10 +240,8 @@ build_zero_init (tree type, tree nelts, bool static_storage_p) inits); CONSTRUCTOR_ELTS (init) = nreverse (inits); } - else if (TREE_CODE (type) == REFERENCE_TYPE) - ; else - abort (); + gcc_assert (TREE_CODE (type) == REFERENCE_TYPE); /* In all cases, the initializer is a constant. */ if (init) @@ -1166,8 +1164,7 @@ expand_default_init (tree binfo, tree true_exp, tree exp, tree init, int flags) && (flags & LOOKUP_ONLYCONVERTING)) { /* Base subobjects should only get direct-initialization. */ - if (true_exp != exp) - abort (); + gcc_assert (true_exp == exp); if (flags & DIRECT_BIND) /* Do nothing. We hit this in two cases: Reference initialization, @@ -2073,9 +2070,9 @@ build_new_1 (tree exp) if (TREE_CODE (init) == TREE_LIST) init = build_x_compound_expr_from_list (init, "new initializer"); - else if (TREE_CODE (init) == CONSTRUCTOR - && TREE_TYPE (init) == NULL_TREE) - abort (); + else + gcc_assert (TREE_CODE (init) != CONSTRUCTOR + || TREE_TYPE (init) != NULL_TREE); init_expr = build_modify_expr (init_expr, INIT_EXPR, init); stable = stabilize_init (init_expr, &init_preeval_expr); @@ -2217,8 +2214,7 @@ build_vec_delete_1 (tree base, tree maxindex, tree type, tree controller = NULL_TREE; /* We should only have 1-D arrays here. */ - if (TREE_CODE (type) == ARRAY_TYPE) - abort (); + gcc_assert (TREE_CODE (type) != ARRAY_TYPE); if (! IS_AGGR_TYPE (type) || TYPE_HAS_TRIVIAL_DESTRUCTOR (type)) goto no_destructor; @@ -2560,7 +2556,7 @@ build_vec_init (tree base, tree maxindex, tree init, int from_array) else if (from) elt_init = build_modify_expr (to, NOP_EXPR, from); else - abort (); + gcc_unreachable (); } else if (TREE_CODE (type) == ARRAY_TYPE) { @@ -2670,7 +2666,7 @@ build_dtor_call (tree exp, special_function_kind dtor_kind, int flags) break; default: - abort (); + gcc_unreachable (); } exp = convert_from_reference (exp); |