summaryrefslogtreecommitdiff
path: root/gcc/cp/class.c
diff options
context:
space:
mode:
authornathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>2004-08-30 15:28:48 +0000
committernathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>2004-08-30 15:28:48 +0000
commit092b1d6f29c36a1496c539d276bc9d0e1ce66082 (patch)
tree4ca6b4e112f696c8ceed5ba25d4dd59e1b129aba /gcc/cp/class.c
parentd6e1a335bca7a6d63ada7dedc95671be86e1a1fe (diff)
downloadgcc-092b1d6f29c36a1496c539d276bc9d0e1ce66082.tar.gz
* 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: svn+ssh://gcc.gnu.org/svn/gcc/trunk@86778 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/class.c')
-rw-r--r--gcc/cp/class.c34
1 files changed, 13 insertions, 21 deletions
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index 1007ebbc289..22781e3c331 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -418,8 +418,7 @@ build_simple_base_path (tree expr, tree binfo)
if (d_binfo == NULL_TREE)
{
- if (TYPE_MAIN_VARIANT (TREE_TYPE (expr)) != type)
- abort ();
+ gcc_assert (TYPE_MAIN_VARIANT (TREE_TYPE (expr)) == type);
return expr;
}
@@ -436,7 +435,7 @@ build_simple_base_path (tree expr, tree binfo)
NULL_TREE, false);
/* Didn't find the base field?!? */
- abort ();
+ gcc_unreachable ();
}
/* Convert OBJECT to the base TYPE. If CHECK_ACCESS is true, an error
@@ -2007,9 +2006,7 @@ get_vcall_index (tree fn, tree type)
return p->value;
/* There should always be an appropriate index. */
- abort ();
-
- return NULL_TREE;
+ gcc_unreachable ();
}
/* Update an entry in the vtable for BINFO, which is in the hierarchy
@@ -4928,10 +4925,8 @@ finish_struct_1 (tree t)
if (COMPLETE_TYPE_P (t))
{
- if (IS_AGGR_TYPE (t))
- error ("redefinition of `%#T'", t);
- else
- abort ();
+ gcc_assert (IS_AGGR_TYPE (t));
+ error ("redefinition of `%#T'", t);
popclass ();
return;
}
@@ -5942,8 +5937,7 @@ instantiate_type (tree lhstype, tree rhs, tsubst_flags_t flags)
case CONVERT_EXPR:
case SAVE_EXPR:
case CONSTRUCTOR:
- abort ();
- return error_mark_node;
+ gcc_unreachable ();
case INDIRECT_REF:
case ARRAY_REF:
@@ -6014,8 +6008,7 @@ instantiate_type (tree lhstype, tree rhs, tsubst_flags_t flags)
case CALL_EXPR:
/* This is too hard for now. */
- abort ();
- return error_mark_node;
+ gcc_unreachable ();
case PLUS_EXPR:
case MINUS_EXPR:
@@ -6124,9 +6117,9 @@ instantiate_type (tree lhstype, tree rhs, tsubst_flags_t flags)
return error_mark_node;
default:
- abort ();
- return error_mark_node;
+ gcc_unreachable ();
}
+ return error_mark_node;
}
/* Return the name of the virtual function pointer field
@@ -6273,7 +6266,7 @@ get_enclosing_class (tree type)
break;
default:
- abort ();
+ gcc_unreachable ();
}
}
return NULL_TREE;
@@ -7604,8 +7597,7 @@ add_vcall_offset_vtbl_entries_1 (tree binfo, vtbl_init_data* vid)
might be a lost primary, so just skip down to vid->binfo. */
if (BINFO_VIRTUAL_P (non_primary_binfo))
{
- if (non_primary_binfo != vid->vbase)
- abort ();
+ gcc_assert (non_primary_binfo == vid->vbase);
non_primary_binfo = vid->binfo;
break;
}
@@ -7794,8 +7786,8 @@ cp_fold_obj_type_ref (tree ref, tree known_type)
fndecl = BV_FN (v);
#ifdef ENABLE_CHECKING
- if (!tree_int_cst_equal (OBJ_TYPE_REF_TOKEN (ref), DECL_VINDEX (fndecl)))
- abort ();
+ gcc_assert (tree_int_cst_equal (OBJ_TYPE_REF_TOKEN (ref),
+ DECL_VINDEX (fndecl)));
#endif
return build_address (fndecl);