Commit 50bc768d by Nathan Sidwell Committed by Nathan Sidwell

call.c (validate_conversion_obstack): Replace my_friendly_assert with gcc_assert…

call.c (validate_conversion_obstack): Replace my_friendly_assert with gcc_assert or gcc_unreachable.

	* call.c (validate_conversion_obstack): Replace
	my_friendly_assert with gcc_assert or gcc_unreachable.
	(direct_reference_binding, merge_conversion_sequences,
	build_user_type_conversion_1, perform_overload_resolution,
	build_op_delete_call, enforce_access, call_builtin_trap,
	build_over_call, build_special_member_call, build_new_method_call,
	initialize_reference): Likewise.
	* class.c (build_base_path, build_primary_vtable, alter_access,
	check_bases, update_vtable_entry_for_fn, layout_empty_base,
	clone_function_decl, adjust_clone_args,
	type_requires_array_cookie, include_empty_classes,
	finish_struct_1, resolve_address_of_overloaded_function,
	instantiate_type, get_vtbl_decl_for_binfo, build_vtt_inits,
	dfs_build_secondary_vptr_vtt_inits, build_ctor_vtbl_group,
	accumulate_vtbl_inits, build_vtbl_initializer,
	build_vbase_offset_vtbl_entries, build_rtti_vtbl_entries): Likewise.
	* cvt.c (build_up_reference, convert_to_reference): Likewise.
	* decl.c (poplevel, duplicate_decls, make_typename_type,
	cxx_init_decl_processing, reshape_init, check_initializer,
	make_rtl_for_nonlocal_decl, initialize_local_var, cp_finish_decl,
	expand_static_init, grokfndecl, grokvardecl, build_ptrmem_type,
	grokdeclarator, copy_fn_p, grok_op_properties, xref_tag,
	xref_basetypes, start_preparsed_function, save_function_data,
	finish_function, finish_method, maybe_register_incomplete_var,
	complete_vars): Likewise.
	* decl2.c (grok_array_decl, check_member_template,
	check_classfn, finish_static_data_member_decl, coerce_new_type,
	coerce_delete_type, import_export_class, decl_needed_p,
	determine_visibility, import_export_decl, build_cleanup,
	start_static_initialization_or_destructi, do_static_destruction,
	prune_vars_needing_no_initialization,
	build_offset_ref_call_from_tree): Likewise.
	* error.c (dump_decl, dump_expr): Likewise.
	* init.c (finish_init_stmts, build_zero_init,
	expand_virtual_init, expand_default_init, expand_aggr_init_1,
	build_offset_ref, build_new_1, build_delete, build_vbase_delete):
	Likewise.
	* mangle.c (write_method_parms, write_template_args,
	write_expression, write_template_arg): Likewise.
	* method.c (make_thunk, finish_thunk, use_thunk): Likewise.
	* name-lookup.c (pop_binding, begin_scope, leave_scope,
	resume_scope, push_using_decl, validate_nonmember_using_decl,
	is_ancestor, poplevel_class, set_inherited_value_binding_p,
	push_class_level_binding, do_class_using_decl, push_namespace,
	pop_namespace, add_using_namespace, ambiguous_decl,
	lookup_namespace_name, lookup_type_current_level,
	maybe_process_template_type_declaration): Likewise.
	* parser.c (cp_lexer_peek_nth_token,
	cp_parser_parse_and_diagnose_invalid_typ,
	cp_parser_translation_unit, cp_parser_template_id,
	cp_parser_lookup_name, cp_parser_late_parsing_for_member): Likewise.
	* pt.c (push_access_scope, finish_member_template_decl,
	push_inline_template_parms_recursive, add_outermost_template_args,
	get_innermost_template_args, begin_explicit_instantiation,
	end_explicit_instantiation, retrieve_specialization,
	is_specialization_of, is_specialization_of_friend,
	register_specialization, check_explicit_specialization,
	comp_template_parms, process_template_parm,
	process_partial_specialization, convert_nontype_argument,
	coerce_template_template_parms, coerce_template_parms,
	mangle_class_name_for_template, lookup_template_function,
	lookup_template_class, instantiate_class_template, tsubst_decl,
	tsubst_function_type, tsubst, tsubst_qualified_id, tsubst_copy,
	instantiate_template, fn_type_unification, type_unification_real,
	get_template_base, regenerate_decl_from_template,
	template_for_substitution, instantiate_decl,
	get_mostly_instantiated_function_type, dependent_scope_ref_p,
	value_dependent_expression_p, resolve_typename_type): Likewise.
	* repo.c (repo_emit_p): Likewise.
	* rtti.c (build_headof, get_tinfo_decl, get_pseudo_ti_init,
	create_tinfo_types, emit_tinfo_decl): Likewise.
	* search.c (lookup_base_r, lookup_base, lookup_field_1,
	dfs_access_in_type, build_baselink, lookup_member,
	adjust_result_of_qualified_name_lookup, copied_binfo): Likewise.
	* semantics.c (perform_or_defer_access_check,
	finish_non_static_data_member, finish_stmt_expr_expr,
	finish_stmt_expr, finish_call_expr, finish_pseudo_destructor_expr,
	finish_template_template_parm, finish_member_declaration,
	emit_associated_thunks): Likewise.
	* tree.c (build_target_expr_with_type, force_target_expr,
	copy_binfo, get_first_fn, cp_tree_equal): Likewise.
	* typeck.c (type_after_usual_arithmetic_conversions, comptypes,
	cxx_sizeof_or_alignof_type, perform_integral_promotions,
	build_class_member_access_expr, finish_class_member_access_expr,
	build_ptrmemfunc_access_expr, build_unary_op,
	unary_complex_lvalue, cxx_mark_addressable, build_modify_expr,
	build_ptrmemfunc, expand_ptrmemfunc_cst, check_return_expr
	* typeck2.c (complete_type_check_abstract,
	abstract_virtuals_error, process_init_constructor,
	add_exception_specifier): Likewise.

From-SVN: r86669
parent e3861d2a
2004-08-27 Nathan Sidwell <nathan@codesourcery.com>
* call.c (validate_conversion_obstack): Replace
my_friendly_assert with gcc_assert or gcc_unreachable.
(direct_reference_binding, merge_conversion_sequences,
build_user_type_conversion_1, perform_overload_resolution,
build_op_delete_call, enforce_access, call_builtin_trap,
build_over_call, build_special_member_call, build_new_method_call,
initialize_reference): Likewise.
* class.c (build_base_path, build_primary_vtable, alter_access,
check_bases, update_vtable_entry_for_fn, layout_empty_base,
clone_function_decl, adjust_clone_args,
type_requires_array_cookie, include_empty_classes,
finish_struct_1, resolve_address_of_overloaded_function,
instantiate_type, get_vtbl_decl_for_binfo, build_vtt_inits,
dfs_build_secondary_vptr_vtt_inits, build_ctor_vtbl_group,
accumulate_vtbl_inits, build_vtbl_initializer,
build_vbase_offset_vtbl_entries, build_rtti_vtbl_entries): Likewise.
* cvt.c (build_up_reference, convert_to_reference): Likewise.
* decl.c (poplevel, duplicate_decls, make_typename_type,
cxx_init_decl_processing, reshape_init, check_initializer,
make_rtl_for_nonlocal_decl, initialize_local_var, cp_finish_decl,
expand_static_init, grokfndecl, grokvardecl, build_ptrmem_type,
grokdeclarator, copy_fn_p, grok_op_properties, xref_tag,
xref_basetypes, start_preparsed_function, save_function_data,
finish_function, finish_method, maybe_register_incomplete_var,
complete_vars): Likewise.
* decl2.c (grok_array_decl, check_member_template,
check_classfn, finish_static_data_member_decl, coerce_new_type,
coerce_delete_type, import_export_class, decl_needed_p,
determine_visibility, import_export_decl, build_cleanup,
start_static_initialization_or_destructi, do_static_destruction,
prune_vars_needing_no_initialization,
build_offset_ref_call_from_tree): Likewise.
* error.c (dump_decl, dump_expr): Likewise.
* init.c (finish_init_stmts, build_zero_init,
expand_virtual_init, expand_default_init, expand_aggr_init_1,
build_offset_ref, build_new_1, build_delete, build_vbase_delete):
Likewise.
* mangle.c (write_method_parms, write_template_args,
write_expression, write_template_arg): Likewise.
* method.c (make_thunk, finish_thunk, use_thunk): Likewise.
* name-lookup.c (pop_binding, begin_scope, leave_scope,
resume_scope, push_using_decl, validate_nonmember_using_decl,
is_ancestor, poplevel_class, set_inherited_value_binding_p,
push_class_level_binding, do_class_using_decl, push_namespace,
pop_namespace, add_using_namespace, ambiguous_decl,
lookup_namespace_name, lookup_type_current_level,
maybe_process_template_type_declaration): Likewise.
* parser.c (cp_lexer_peek_nth_token,
cp_parser_parse_and_diagnose_invalid_typ,
cp_parser_translation_unit, cp_parser_template_id,
cp_parser_lookup_name, cp_parser_late_parsing_for_member): Likewise.
* pt.c (push_access_scope, finish_member_template_decl,
push_inline_template_parms_recursive, add_outermost_template_args,
get_innermost_template_args, begin_explicit_instantiation,
end_explicit_instantiation, retrieve_specialization,
is_specialization_of, is_specialization_of_friend,
register_specialization, check_explicit_specialization,
comp_template_parms, process_template_parm,
process_partial_specialization, convert_nontype_argument,
coerce_template_template_parms, coerce_template_parms,
mangle_class_name_for_template, lookup_template_function,
lookup_template_class, instantiate_class_template, tsubst_decl,
tsubst_function_type, tsubst, tsubst_qualified_id, tsubst_copy,
instantiate_template, fn_type_unification, type_unification_real,
get_template_base, regenerate_decl_from_template,
template_for_substitution, instantiate_decl,
get_mostly_instantiated_function_type, dependent_scope_ref_p,
value_dependent_expression_p, resolve_typename_type): Likewise.
* repo.c (repo_emit_p): Likewise.
* rtti.c (build_headof, get_tinfo_decl, get_pseudo_ti_init,
create_tinfo_types, emit_tinfo_decl): Likewise.
* search.c (lookup_base_r, lookup_base, lookup_field_1,
dfs_access_in_type, build_baselink, lookup_member,
adjust_result_of_qualified_name_lookup, copied_binfo): Likewise.
* semantics.c (perform_or_defer_access_check,
finish_non_static_data_member, finish_stmt_expr_expr,
finish_stmt_expr, finish_call_expr, finish_pseudo_destructor_expr,
finish_template_template_parm, finish_member_declaration,
emit_associated_thunks): Likewise.
* tree.c (build_target_expr_with_type, force_target_expr,
copy_binfo, get_first_fn, cp_tree_equal): Likewise.
* typeck.c (type_after_usual_arithmetic_conversions, comptypes,
cxx_sizeof_or_alignof_type, perform_integral_promotions,
build_class_member_access_expr, finish_class_member_access_expr,
build_ptrmemfunc_access_expr, build_unary_op,
unary_complex_lvalue, cxx_mark_addressable, build_modify_expr,
build_ptrmemfunc, expand_ptrmemfunc_cst, check_return_expr
* typeck2.c (complete_type_check_abstract,
abstract_virtuals_error, process_init_constructor,
add_exception_specifier): Likewise.
2004-08-27 Nathan Sidwell <nathan@codesourcery.com>
* class.c (build_vtbl_initializer): Use ssize_int.
* decl.c (complete_array_type): Likewise.
* method.c (finish_thunk): Likewise.
......
......@@ -497,9 +497,8 @@ void
validate_conversion_obstack (void)
{
if (conversion_obstack_initialized)
my_friendly_assert ((obstack_next_free (&conversion_obstack)
== obstack_base (&conversion_obstack)),
20040208);
gcc_assert ((obstack_next_free (&conversion_obstack)
== obstack_base (&conversion_obstack)));
}
#endif /* ENABLE_CHECKING */
......@@ -1033,8 +1032,8 @@ direct_reference_binding (tree type, conversion *conv)
{
tree t;
my_friendly_assert (TREE_CODE (type) == REFERENCE_TYPE, 20030306);
my_friendly_assert (TREE_CODE (conv->type) != REFERENCE_TYPE, 20030306);
gcc_assert (TREE_CODE (type) == REFERENCE_TYPE);
gcc_assert (TREE_CODE (conv->type) != REFERENCE_TYPE);
t = TREE_TYPE (type);
......@@ -2464,7 +2463,7 @@ merge_conversion_sequences (conversion *user_seq, conversion *std_seq)
{
conversion **t;
my_friendly_assert (user_seq->kind == ck_user, 20030306);
gcc_assert (user_seq->kind == ck_user);
/* Find the end of the second conversion sequence. */
t = &(std_seq);
......@@ -2501,8 +2500,8 @@ build_user_type_conversion_1 (tree totype, tree expr, int flags)
/* We represent conversion within a hierarchy using RVALUE_CONV and
BASE_CONV, as specified by [over.best.ics]; these become plain
constructor calls, as specified in [dcl.init]. */
my_friendly_assert (!IS_AGGR_TYPE (fromtype) || !IS_AGGR_TYPE (totype)
|| !DERIVED_FROM_P (totype, fromtype), 20011226);
gcc_assert (!IS_AGGR_TYPE (fromtype) || !IS_AGGR_TYPE (totype)
|| !DERIVED_FROM_P (totype, fromtype));
if (IS_AGGR_TYPE (totype))
ctors = lookup_fnfields (totype, complete_ctor_identifier, 0);
......@@ -2523,9 +2522,8 @@ build_user_type_conversion_1 (tree totype, tree expr, int flags)
args = build_tree_list (NULL_TREE, expr);
/* We should never try to call the abstract or base constructor
from here. */
my_friendly_assert (!DECL_HAS_IN_CHARGE_PARM_P (OVL_CURRENT (ctors))
&& !DECL_HAS_VTT_PARM_P (OVL_CURRENT (ctors)),
20011226);
gcc_assert (!DECL_HAS_IN_CHARGE_PARM_P (OVL_CURRENT (ctors))
&& !DECL_HAS_VTT_PARM_P (OVL_CURRENT (ctors)));
args = tree_cons (NULL_TREE, t, args);
}
for (; ctors; ctors = OVL_NEXT (ctors))
......@@ -2718,13 +2716,11 @@ perform_overload_resolution (tree fn,
*any_viable_p = true;
/* Check FN and ARGS. */
my_friendly_assert (TREE_CODE (fn) == FUNCTION_DECL
|| TREE_CODE (fn) == TEMPLATE_DECL
|| TREE_CODE (fn) == OVERLOAD
|| TREE_CODE (fn) == TEMPLATE_ID_EXPR,
20020712);
my_friendly_assert (!args || TREE_CODE (args) == TREE_LIST,
20020712);
gcc_assert (TREE_CODE (fn) == FUNCTION_DECL
|| TREE_CODE (fn) == TEMPLATE_DECL
|| TREE_CODE (fn) == OVERLOAD
|| TREE_CODE (fn) == TEMPLATE_ID_EXPR);
gcc_assert (!args || TREE_CODE (args) == TREE_LIST);
if (TREE_CODE (fn) == TEMPLATE_ID_EXPR)
{
......@@ -3960,7 +3956,7 @@ build_op_delete_call (enum tree_code code, tree addr, tree size,
call_expr = placement;
/* Extract the function. */
alloc_fn = get_callee_fndecl (call_expr);
my_friendly_assert (alloc_fn != NULL_TREE, 20020327);
gcc_assert (alloc_fn != NULL_TREE);
/* Then the second parm type. */
argtypes = TREE_CHAIN (TYPE_ARG_TYPES (TREE_TYPE (alloc_fn)));
/* Also the second argument. */
......@@ -4068,7 +4064,7 @@ build_op_delete_call (enum tree_code code, tree addr, tree size,
bool
enforce_access (tree basetype_path, tree decl)
{
my_friendly_assert (TREE_CODE (basetype_path) == TREE_BINFO, 20030624);
gcc_assert (TREE_CODE (basetype_path) == TREE_BINFO);
if (!accessible_p (basetype_path, decl))
{
......@@ -4356,7 +4352,7 @@ call_builtin_trap (void)
{
tree fn = implicit_built_in_decls[BUILT_IN_TRAP];
my_friendly_assert (fn != NULL, 20030927);
gcc_assert (fn != NULL);
fn = build_call (fn, NULL_TREE);
return fn;
}
......@@ -4682,9 +4678,9 @@ build_over_call (struct z_candidate *cand, int flags)
So we can assume that anything passed as 'this' is non-null, and
optimize accordingly. */
my_friendly_assert (TREE_CODE (parmtype) == POINTER_TYPE, 19990811);
gcc_assert (TREE_CODE (parmtype) == POINTER_TYPE);
/* Convert to the base in which the function was declared. */
my_friendly_assert (cand->conversion_path != NULL_TREE, 20020730);
gcc_assert (cand->conversion_path != NULL_TREE);
converted_arg = build_base_path (PLUS_EXPR,
TREE_VALUE (arg),
cand->conversion_path,
......@@ -4851,7 +4847,7 @@ build_over_call (struct z_candidate *cand, int flags)
tree binfo = lookup_base (TREE_TYPE (TREE_TYPE (*p)),
DECL_CONTEXT (fn),
ba_any, NULL);
my_friendly_assert (binfo && binfo != error_mark_node, 20010730);
gcc_assert (binfo && binfo != error_mark_node);
*p = build_base_path (PLUS_EXPR, *p, binfo, 1);
if (TREE_SIDE_EFFECTS (*p))
......@@ -5012,13 +5008,12 @@ build_special_member_call (tree instance, tree name, tree args,
/* The type of the subobject to be constructed or destroyed. */
tree class_type;
my_friendly_assert (name == complete_ctor_identifier
|| name == base_ctor_identifier
|| name == complete_dtor_identifier
|| name == base_dtor_identifier
|| name == deleting_dtor_identifier
|| name == ansi_assopname (NOP_EXPR),
20020712);
gcc_assert (name == complete_ctor_identifier
|| name == base_ctor_identifier
|| name == complete_dtor_identifier
|| name == base_dtor_identifier
|| name == deleting_dtor_identifier
|| name == ansi_assopname (NOP_EXPR));
if (TYPE_P (binfo))
{
/* Resolve the name. */
......@@ -5028,7 +5023,7 @@ build_special_member_call (tree instance, tree name, tree args,
binfo = TYPE_BINFO (binfo);
}
my_friendly_assert (binfo != NULL_TREE, 20020712);
gcc_assert (binfo != NULL_TREE);
class_type = BINFO_TYPE (binfo);
......@@ -5043,7 +5038,7 @@ build_special_member_call (tree instance, tree name, tree args,
if (name == complete_dtor_identifier
|| name == base_dtor_identifier
|| name == deleting_dtor_identifier)
my_friendly_assert (args == NULL_TREE, 20020712);
gcc_assert (args == NULL_TREE);
/* Convert to the base class, if necessary. */
if (!same_type_ignoring_top_level_qualifiers_p
......@@ -5064,7 +5059,7 @@ build_special_member_call (tree instance, tree name, tree args,
}
}
my_friendly_assert (instance != NULL_TREE, 20020712);
gcc_assert (instance != NULL_TREE);
fns = lookup_fnfields (binfo, name, 1);
......@@ -5088,7 +5083,7 @@ build_special_member_call (tree instance, tree name, tree args,
current_in_charge_parm, integer_zero_node),
current_vtt_parm,
vtt);
my_friendly_assert (BINFO_SUBVTT_INDEX (binfo), 20010110);
gcc_assert (BINFO_SUBVTT_INDEX (binfo));
sub_vtt = build2 (PLUS_EXPR, TREE_TYPE (vtt), vtt,
BINFO_SUBVTT_INDEX (binfo));
......@@ -5169,7 +5164,7 @@ build_new_method_call (tree instance, tree fns, tree args,
tree orig_args;
void *p;
my_friendly_assert (instance != NULL_TREE, 20020729);
gcc_assert (instance != NULL_TREE);
if (error_operand_p (instance)
|| error_operand_p (fns)
......@@ -5220,10 +5215,9 @@ build_new_method_call (tree instance, tree fns, tree args,
template_only = 1;
}
my_friendly_assert (TREE_CODE (fns) == FUNCTION_DECL
|| TREE_CODE (fns) == TEMPLATE_DECL
|| TREE_CODE (fns) == OVERLOAD,
20020712);
gcc_assert (TREE_CODE (fns) == FUNCTION_DECL
|| TREE_CODE (fns) == TEMPLATE_DECL
|| TREE_CODE (fns) == OVERLOAD);
/* XXX this should be handled before we get here. */
if (! IS_AGGR_TYPE (basetype))
......@@ -5242,9 +5236,9 @@ build_new_method_call (tree instance, tree fns, tree args,
{
/* Callers should explicitly indicate whether they want to construct
the complete object or just the part without virtual bases. */
my_friendly_assert (name != ctor_identifier, 20000408);
gcc_assert (name != ctor_identifier);
/* Similarly for destructors. */
my_friendly_assert (name != dtor_identifier, 20000408);
gcc_assert (name != dtor_identifier);
}
/* It's OK to call destructors on cv-qualified objects. Therefore,
......@@ -6147,7 +6141,7 @@ the worst conversion for the second:");
}
}
my_friendly_assert (!winner, 20010121);
gcc_assert (!winner);
return 0;
}
......@@ -6443,7 +6437,7 @@ initialize_reference (tree type, tree expr, tree decl, tree *cleanup)
we can extend the lifetime of the return value of the conversion
operator. */
my_friendly_assert (conv->kind == ck_ref_bind, 20030302);
gcc_assert (conv->kind == ck_ref_bind);
if (decl)
{
tree var;
......
......@@ -366,7 +366,7 @@ build_up_reference (tree type, tree arg, int flags, tree decl)
tree argtype = TREE_TYPE (arg);
tree target_type = TREE_TYPE (type);
my_friendly_assert (TREE_CODE (type) == REFERENCE_TYPE, 187);
gcc_assert (TREE_CODE (type) == REFERENCE_TYPE);
if ((flags & DIRECT_BIND) && ! real_lvalue_p (arg))
{
......@@ -470,7 +470,7 @@ convert_to_reference (tree reftype, tree expr, int convtype,
intype = TREE_TYPE (expr);
my_friendly_assert (TREE_CODE (intype) != REFERENCE_TYPE, 364);
gcc_assert (TREE_CODE (intype) != REFERENCE_TYPE);
intype = TYPE_MAIN_VARIANT (intype);
......
......@@ -338,7 +338,7 @@ grok_array_decl (tree array_expr, tree index_exp)
}
type = TREE_TYPE (array_expr);
my_friendly_assert (type, 20030626);
gcc_assert (type);
type = non_reference (type);
/* If they have an `operator[]', use that. */
......@@ -473,7 +473,7 @@ check_member_template (tree tmpl)
{
tree decl;
my_friendly_assert (TREE_CODE (tmpl) == TEMPLATE_DECL, 0);
gcc_assert (TREE_CODE (tmpl) == TEMPLATE_DECL);
decl = DECL_TEMPLATE_RESULT (tmpl);
if (TREE_CODE (decl) == FUNCTION_DECL
......@@ -612,11 +612,9 @@ check_classfn (tree ctype, tree function, tree template_parms)
either were not passed, or they are the same of DECL_TEMPLATE_PARMS. */
if (TREE_CODE (function) == TEMPLATE_DECL)
{
my_friendly_assert (!template_parms
|| comp_template_parms
(template_parms,
DECL_TEMPLATE_PARMS (function)),
20040303);
gcc_assert (!template_parms
|| comp_template_parms (template_parms,
DECL_TEMPLATE_PARMS (function)));
template_parms = DECL_TEMPLATE_PARMS (function);
}
......@@ -765,7 +763,7 @@ void
finish_static_data_member_decl (tree decl, tree init, tree asmspec_tree,
int flags)
{
my_friendly_assert (TREE_PUBLIC (decl), 0);
gcc_assert (TREE_PUBLIC (decl));
DECL_CONTEXT (decl) = current_class_type;
......@@ -1238,7 +1236,7 @@ coerce_new_type (tree type)
int e = 0;
tree args = TYPE_ARG_TYPES (type);
my_friendly_assert (TREE_CODE (type) == FUNCTION_TYPE, 20001107);
gcc_assert (TREE_CODE (type) == FUNCTION_TYPE);
if (!same_type_p (TREE_TYPE (type), ptr_type_node))
e = 1, error ("`operator new' must return type `%T'", ptr_type_node);
......@@ -1272,7 +1270,7 @@ coerce_delete_type (tree type)
int e = 0;
tree args = TYPE_ARG_TYPES (type);
my_friendly_assert (TREE_CODE (type) == FUNCTION_TYPE, 20001107);
gcc_assert (TREE_CODE (type) == FUNCTION_TYPE);
if (!same_type_p (TREE_TYPE (type), void_type_node))
e = 1, error ("`operator delete' must return type `%T'", void_type_node);
......@@ -1435,7 +1433,7 @@ import_export_class (tree ctype)
non-abstract virtual member function has been defined in this
translation unit. But, we can't possibly know that until we've
seen the entire translation unit. */
my_friendly_assert (at_eof, 20000226);
gcc_assert (at_eof);
if (CLASSTYPE_INTERFACE_KNOWN (ctype))
return;
......@@ -1520,13 +1518,12 @@ mark_needed (tree decl)
bool
decl_needed_p (tree decl)
{
my_friendly_assert (TREE_CODE (decl) == VAR_DECL
|| TREE_CODE (decl) == FUNCTION_DECL,
20040726);
gcc_assert (TREE_CODE (decl) == VAR_DECL
|| TREE_CODE (decl) == FUNCTION_DECL);
/* This function should only be called at the end of the translation
unit. We cannot be sure of whether or not something will be
COMDAT until that point. */
my_friendly_assert (at_eof, 20040726);
gcc_assert (at_eof);
/* All entities with external linkage that are not COMDAT should be
emitted; they may be referred to from other object files. */
......@@ -1622,7 +1619,7 @@ determine_visibility (tree decl)
/* Cloned constructors and destructors get the same visibility as
the underlying function. That should be set up in
maybe_clone_body. */
my_friendly_assert (!DECL_CLONED_FUNCTION_P (decl), 20040804);
gcc_assert (!DECL_CLONED_FUNCTION_P (decl));
/* Give the common code a chance to make a determination. */
if (c_determine_visibility (decl))
......@@ -1640,8 +1637,8 @@ determine_visibility (tree decl)
{
/* Virtual tables have DECL_CONTEXT set to their associated class,
so they are automatically handled above. */
my_friendly_assert (!(TREE_CODE (decl) == VAR_DECL
&& DECL_VTABLE_OR_VTT_P (decl)), 20040803);
gcc_assert (TREE_CODE (decl) != VAR_DECL
|| !DECL_VTABLE_OR_VTT_P (decl));
/* Entities not associated with any class just get the
visibility specified by their attributes. */
return;
......@@ -1705,7 +1702,7 @@ import_export_decl (tree decl)
"-frepo" it would be incorrect to make decisions about what
entities to emit when building the PCH; those decisions must be
delayed until the repository information has been processed. */
my_friendly_assert (at_eof, 20040727);
gcc_assert (at_eof);
/* Object file linkage for explicit instantiations is handled in
mark_decl_instantiated. For static variables in functions with
vague linkage, maybe_commonize_var is used.
......@@ -1728,25 +1725,22 @@ import_export_decl (tree decl)
definition available in this translation unit.
The following assertions check these conditions. */
my_friendly_assert (TREE_CODE (decl) == FUNCTION_DECL
|| TREE_CODE (decl) == VAR_DECL,
2004725);
gcc_assert (TREE_CODE (decl) == FUNCTION_DECL
|| TREE_CODE (decl) == VAR_DECL);
/* Any code that creates entities with TREE_PUBLIC cleared should
also set DECL_INTERFACE_KNOWN. */
my_friendly_assert (TREE_PUBLIC (decl), 20040725);
gcc_assert (TREE_PUBLIC (decl));
if (TREE_CODE (decl) == FUNCTION_DECL)
my_friendly_assert (DECL_IMPLICIT_INSTANTIATION (decl)
|| DECL_FRIEND_PSEUDO_TEMPLATE_INSTANTIATION (decl)
|| DECL_DECLARED_INLINE_P (decl),
20040725);
gcc_assert (DECL_IMPLICIT_INSTANTIATION (decl)
|| DECL_FRIEND_PSEUDO_TEMPLATE_INSTANTIATION (decl)
|| DECL_DECLARED_INLINE_P (decl));
else
my_friendly_assert (DECL_IMPLICIT_INSTANTIATION (decl)
|| DECL_VTABLE_OR_VTT_P (decl)
|| DECL_TINFO_P (decl),
20040725);
gcc_assert (DECL_IMPLICIT_INSTANTIATION (decl)
|| DECL_VTABLE_OR_VTT_P (decl)
|| DECL_TINFO_P (decl));
/* Check that a definition of DECL is available in this translation
unit. */
my_friendly_assert (!DECL_REALLY_EXTERN (decl), 20040725);
gcc_assert (!DECL_REALLY_EXTERN (decl));
/* Assume that DECL will not have COMDAT linkage. */
comdat_p = false;
......@@ -1923,7 +1917,7 @@ build_cleanup (tree decl)
/* This function should only be called for declarations that really
require cleanups. */
my_friendly_assert (!TYPE_HAS_TRIVIAL_DESTRUCTOR (type), 20030106);
gcc_assert (!TYPE_HAS_TRIVIAL_DESTRUCTOR (type));
/* Treat all objects with destructors as used; the destructor may do
something substantive. */
......@@ -2378,7 +2372,7 @@ start_static_initialization_or_destruction (tree decl, int initp)
{
/* When using __cxa_atexit, we never try to destroy
anything from a static destructor. */
my_friendly_assert (initp, 20000629);
gcc_assert (initp);
guard_cond = get_guard_cond (guard);
}
/* If we don't have __cxa_atexit, then we will be running
......@@ -2470,7 +2464,7 @@ do_static_destruction (tree decl)
/* If we're using __cxa_atexit, then destructors are registered
immediately after objects are initialized. */
my_friendly_assert (!flag_use_cxa_atexit, 20000121);
gcc_assert (!flag_use_cxa_atexit);
/* If we don't need a destructor, there's nothing to do. */
if (TYPE_HAS_TRIVIAL_DESTRUCTOR (TREE_TYPE (decl)))
......@@ -2511,7 +2505,7 @@ prune_vars_needing_no_initialization (tree *vars)
}
/* The only things that can be initialized are variables. */
my_friendly_assert (TREE_CODE (decl) == VAR_DECL, 19990420);
gcc_assert (TREE_CODE (decl) == VAR_DECL);
/* If this object is not defined, we don't need to do anything
here. */
......@@ -3120,9 +3114,8 @@ build_offset_ref_call_from_tree (tree fn, tree args)
if (processing_template_decl)
{
my_friendly_assert (TREE_CODE (fn) == DOTSTAR_EXPR
|| TREE_CODE (fn) == MEMBER_REF,
20030708);
gcc_assert (TREE_CODE (fn) == DOTSTAR_EXPR
|| TREE_CODE (fn) == MEMBER_REF);
if (type_dependent_expression_p (fn)
|| any_type_dependent_arguments_p (args))
return build_min_nt (CALL_EXPR, fn, args, NULL_TREE);
......
......@@ -735,7 +735,7 @@ dump_decl (tree t, int flags)
if (DECL_NAME (t) && VTABLE_NAME_P (DECL_NAME (t)))
{
pp_string (cxx_pp, "vtable for ");
my_friendly_assert (TYPE_P (DECL_CONTEXT (t)), 20010720);
gcc_assert (TYPE_P (DECL_CONTEXT (t)));
dump_type (DECL_CONTEXT (t), flags);
break;
}
......@@ -1528,7 +1528,7 @@ dump_expr (tree t, int flags)
if (TREE_HAS_CONSTRUCTOR (t))
{
t = TREE_OPERAND (t, 0);
my_friendly_assert (TREE_CODE (t) == CALL_EXPR, 237);
gcc_assert (TREE_CODE (t) == CALL_EXPR);
dump_expr (TREE_OPERAND (t, 0), flags | TFF_EXPR_IN_PARENS);
pp_cxx_left_paren (cxx_pp);
dump_expr_list (TREE_CHAIN (TREE_OPERAND (t, 1)), flags);
......@@ -1761,7 +1761,7 @@ dump_expr (tree t, int flags)
pp_cxx_identifier (cxx_pp, "sizeof");
else
{
my_friendly_assert (TREE_CODE (t) == ALIGNOF_EXPR, 0);
gcc_assert (TREE_CODE (t) == ALIGNOF_EXPR);
pp_cxx_identifier (cxx_pp, "__alignof__");
}
pp_cxx_whitespace (cxx_pp);
......
......@@ -87,7 +87,7 @@ finish_init_stmts (bool is_global, tree stmt_expr, tree compound_stmt)
stmt_expr = finish_stmt_expr (stmt_expr, true);
my_friendly_assert (!building_stmt_tree () == is_global, 20030726);
gcc_assert (!building_stmt_tree () == is_global);
return stmt_expr;
}
......@@ -171,8 +171,7 @@ build_zero_init (tree type, tree nelts, bool static_storage_p)
-- if T is a reference type, no initialization is performed. */
my_friendly_assert (nelts == NULL_TREE || TREE_CODE (nelts) == INTEGER_CST,
20030618);
gcc_assert (nelts == NULL_TREE || TREE_CODE (nelts) == INTEGER_CST);
if (type == error_mark_node)
;
......@@ -226,7 +225,7 @@ build_zero_init (tree type, tree nelts, bool static_storage_p)
/* Iterate over the array elements, building initializations. */
inits = NULL_TREE;
max_index = nelts ? nelts : array_type_nelts (type);
my_friendly_assert (TREE_CODE (max_index) == INTEGER_CST, 20030618);
gcc_assert (TREE_CODE (max_index) == INTEGER_CST);
/* A zero-sized array, which is accepted as an extension, will
have an upper bound of -1. */
......@@ -787,7 +786,7 @@ expand_virtual_init (tree binfo, tree decl)
/* Compute the location of the vtpr. */
vtbl_ptr = build_vfield_ref (build_indirect_ref (decl, NULL),
TREE_TYPE (binfo));
my_friendly_assert (vtbl_ptr != error_mark_node, 20010730);
gcc_assert (vtbl_ptr != error_mark_node);
/* Assign the vtable to the vptr. */
vtbl = convert_force (TREE_TYPE (vtbl_ptr), vtbl, 0);
......@@ -1180,7 +1179,7 @@ expand_default_init (tree binfo, tree true_exp, tree exp, tree init, int flags)
else if (BRACE_ENCLOSED_INITIALIZER_P (init))
{
/* A brace-enclosed initializer for an aggregate. */
my_friendly_assert (CP_AGGREGATE_TYPE_P (type), 20021016);
gcc_assert (CP_AGGREGATE_TYPE_P (type));
init = digest_init (type, init, (tree *)NULL);
}
else
......@@ -1248,8 +1247,8 @@ expand_aggr_init_1 (tree binfo, tree true_exp, tree exp, tree init, int flags)
{
tree type = TREE_TYPE (exp);
my_friendly_assert (init != error_mark_node && type != error_mark_node, 211);
my_friendly_assert (building_stmt_tree (), 20021010);
gcc_assert (init != error_mark_node && type != error_mark_node);
gcc_assert (building_stmt_tree ());
/* Use a function returning the desired type to initialize EXP for us.
If the function is a constructor, and its first argument is
......@@ -1351,7 +1350,7 @@ build_offset_ref (tree type, tree name, bool address_p)
name = DECL_NAME (OVL_CURRENT (name));
}
my_friendly_assert (TREE_CODE (name) == IDENTIFIER_NODE, 0);
gcc_assert (TREE_CODE (name) == IDENTIFIER_NODE);
}
if (type == NULL_TREE)
......@@ -1953,7 +1952,7 @@ build_new_1 (tree exp)
while (TREE_CODE (alloc_call) == COMPOUND_EXPR)
alloc_call = TREE_OPERAND (alloc_call, 1);
alloc_fn = get_callee_fndecl (alloc_call);
my_friendly_assert (alloc_fn != NULL_TREE, 20020325);
gcc_assert (alloc_fn != NULL_TREE);
/* Now, check to see if this function is actually a placement
allocation function. This can happen even when PLACEMENT is NULL
......@@ -2769,7 +2768,7 @@ build_delete (tree type, tree addr, special_function_kind auto_delete,
addr = convert_force (build_pointer_type (type), addr, 0);
}
my_friendly_assert (IS_AGGR_TYPE (type), 220);
gcc_assert (IS_AGGR_TYPE (type));
if (TYPE_HAS_TRIVIAL_DESTRUCTOR (type))
{
......@@ -2785,7 +2784,7 @@ build_delete (tree type, tree addr, special_function_kind auto_delete,
tree do_delete = NULL_TREE;
tree ifexp;
my_friendly_assert (TYPE_HAS_DESTRUCTOR (type), 20011213);
gcc_assert (TYPE_HAS_DESTRUCTOR (type));
/* For `::delete x', we must not use the deleting destructor
since then we would not be sure to get the global `operator
......@@ -2935,7 +2934,7 @@ build_vbase_delete (tree type, tree decl)
VEC (tree) *vbases;
tree addr = build_unary_op (ADDR_EXPR, decl, 0);
my_friendly_assert (addr != error_mark_node, 222);
gcc_assert (addr != error_mark_node);
result = convert_to_void (integer_zero_node, NULL);
for (vbases = CLASSTYPE_VBASECLASSES (type), ix = 0;
......
......@@ -1853,7 +1853,7 @@ write_method_parms (tree parm_types, const int method_p, const tree decl)
fixed-length. */
varargs_p = 0;
/* A void type better be the last one. */
my_friendly_assert (TREE_CHAIN (parm_types) == NULL, 20000523);
gcc_assert (TREE_CHAIN (parm_types) == NULL);
}
else
write_type (parm);
......@@ -1887,7 +1887,7 @@ write_template_args (tree args)
write_char ('I');
my_friendly_assert (length > 0, 20000422);
gcc_assert (length > 0);
if (TREE_CODE (TREE_VEC_ELT (args, 0)) == TREE_VEC)
{
......@@ -2095,8 +2095,7 @@ write_expression (tree expr)
template_id = TREE_OPERAND (expr, 1);
name = TREE_OPERAND (template_id, 0);
/* FIXME: What about operators? */
my_friendly_assert (TREE_CODE (name) == IDENTIFIER_NODE,
20030707);
gcc_assert (TREE_CODE (name) == IDENTIFIER_NODE);
write_source_name (TREE_OPERAND (template_id, 0));
write_template_args (TREE_OPERAND (template_id, 1));
}
......@@ -2201,8 +2200,7 @@ write_template_arg (tree node)
/* Template parameters can be of reference type. To maintain
internal consistency, such arguments use a conversion from
address of object to reference type. */
my_friendly_assert (TREE_CODE (TREE_OPERAND (node, 0)) == ADDR_EXPR,
20031215);
gcc_assert (TREE_CODE (TREE_OPERAND (node, 0)) == ADDR_EXPR);
if (abi_version_at_least (2))
node = TREE_OPERAND (TREE_OPERAND (node, 0), 0);
else
......
......@@ -88,11 +88,10 @@ make_thunk (tree function, bool this_adjusting,
HOST_WIDE_INT d;
tree thunk;
my_friendly_assert (TREE_CODE (function) == FUNCTION_DECL, 20021025);
gcc_assert (TREE_CODE (function) == FUNCTION_DECL);
/* We can have this thunks to covariant thunks, but not vice versa. */
my_friendly_assert (!DECL_THIS_THUNK_P (function), 20021127);
my_friendly_assert (!DECL_RESULT_THUNK_P (function) || this_adjusting,
20031123);
gcc_assert (!DECL_THIS_THUNK_P (function));
gcc_assert (!DECL_RESULT_THUNK_P (function) || this_adjusting);
/* Scale the VIRTUAL_OFFSET to be in terms of bytes. */
if (this_adjusting && virtual_offset)
......@@ -121,12 +120,11 @@ make_thunk (tree function, bool this_adjusting,
/* All thunks must be created before FUNCTION is actually emitted;
the ABI requires that all thunks be emitted together with the
function to which they transfer control. */
my_friendly_assert (!TREE_ASM_WRITTEN (function), 20021025);
gcc_assert (!TREE_ASM_WRITTEN (function));
/* Likewise, we can only be adding thunks to a function declared in
the class currently being laid out. */
my_friendly_assert (TYPE_SIZE (DECL_CONTEXT (function))
&& TYPE_BEING_DEFINED (DECL_CONTEXT (function)),
20031211);
gcc_assert (TYPE_SIZE (DECL_CONTEXT (function))
&& TYPE_BEING_DEFINED (DECL_CONTEXT (function)));
thunk = build_decl (FUNCTION_DECL, NULL_TREE, TREE_TYPE (function));
DECL_LANG_SPECIFIC (thunk) = DECL_LANG_SPECIFIC (function);
......@@ -182,7 +180,7 @@ finish_thunk (tree thunk)
tree fixed_offset = ssize_int (THUNK_FIXED_OFFSET (thunk));
tree virtual_offset = THUNK_VIRTUAL_OFFSET (thunk);
my_friendly_assert (!DECL_NAME (thunk) && DECL_THUNK_P (thunk), 20021127);
gcc_assert (!DECL_NAME (thunk) && DECL_THUNK_P (thunk));
if (virtual_offset && DECL_RESULT_THUNK_P (thunk))
virtual_offset = BINFO_VPTR_FIELD (virtual_offset);
function = THUNK_TARGET (thunk);
......@@ -202,7 +200,7 @@ finish_thunk (tree thunk)
cov_probe; cov_probe = TREE_CHAIN (cov_probe))
if (DECL_NAME (cov_probe) == name)
{
my_friendly_assert (!DECL_THUNKS (thunk), 20031023);
gcc_assert (!DECL_THUNKS (thunk));
THUNK_ALIAS (thunk) = (THUNK_ALIAS (cov_probe)
? THUNK_ALIAS (cov_probe) : cov_probe);
break;
......@@ -317,11 +315,11 @@ use_thunk (tree thunk_fndecl, bool emit_p)
bool this_adjusting = DECL_THIS_THUNK_P (thunk_fndecl);
/* We should have called finish_thunk to give it a name. */
my_friendly_assert (DECL_NAME (thunk_fndecl), 20021127);
gcc_assert (DECL_NAME (thunk_fndecl));
/* We should never be using an alias, always refer to the
aliased thunk. */
my_friendly_assert (!THUNK_ALIAS (thunk_fndecl), 20031023);
gcc_assert (!THUNK_ALIAS (thunk_fndecl));
if (TREE_ASM_WRITTEN (thunk_fndecl))
return;
......@@ -355,7 +353,7 @@ use_thunk (tree thunk_fndecl, bool emit_p)
if (!this_adjusting)
virtual_offset = BINFO_VPTR_FIELD (virtual_offset);
virtual_value = tree_low_cst (virtual_offset, /*pos=*/0);
my_friendly_assert (virtual_value, 20021026);
gcc_assert (virtual_value);
}
else
virtual_value = 0;
......
......@@ -451,7 +451,7 @@ pop_binding (tree id, tree decl)
binding = IDENTIFIER_BINDING (id);
/* The name should be bound. */
my_friendly_assert (binding != NULL, 0);
gcc_assert (binding != NULL);
/* The DECL will be either the ordinary binding or the type
binding for this identifier. Remove that binding. */
......@@ -1345,7 +1345,7 @@ begin_scope (scope_kind kind, tree entity)
default:
/* Should not happen. */
my_friendly_assert (false, 20030922);
gcc_unreachable ();
break;
}
scope->kind = kind;
......@@ -1368,7 +1368,7 @@ leave_scope (void)
/* We cannot leave a scope, if there are none left. */
if (NAMESPACE_LEVEL (global_namespace))
my_friendly_assert (!global_scope_p (scope), 20030527);
gcc_assert (!global_scope_p (scope));
if (ENABLE_SCOPE_CHECKING)
{
......@@ -1398,9 +1398,8 @@ leave_scope (void)
scope->type_decls = NULL;
else
binding_table_free (scope->type_decls);
my_friendly_assert (!ENABLE_SCOPE_CHECKING
|| scope->binding_depth == binding_depth,
20030529);
gcc_assert (!ENABLE_SCOPE_CHECKING
|| scope->binding_depth == binding_depth);
free_binding_level = scope;
}
......@@ -1420,9 +1419,9 @@ resume_scope (struct cp_binding_level* b)
{
/* Resuming binding levels is meant only for namespaces,
and those cannot nest into classes. */
my_friendly_assert(!class_binding_level, 386);
gcc_assert (!class_binding_level);
/* Also, resuming a non-directly nested namespace is a no-no. */
my_friendly_assert(b->level_chain == current_binding_level, 386);
gcc_assert (b->level_chain == current_binding_level);
current_binding_level = b;
if (ENABLE_SCOPE_CHECKING)
{
......@@ -1929,8 +1928,8 @@ push_using_decl (tree scope, tree name)
tree decl;
timevar_push (TV_NAME_LOOKUP);
my_friendly_assert (TREE_CODE (scope) == NAMESPACE_DECL, 383);
my_friendly_assert (TREE_CODE (name) == IDENTIFIER_NODE, 384);
gcc_assert (TREE_CODE (scope) == NAMESPACE_DECL);
gcc_assert (TREE_CODE (name) == IDENTIFIER_NODE);
for (decl = current_binding_level->usings; decl; decl = TREE_CHAIN (decl))
if (DECL_INITIAL (decl) == scope && DECL_NAME (decl) == name)
break;
......@@ -2151,7 +2150,7 @@ validate_nonmember_using_decl (tree decl, tree scope, tree name)
if (is_overloaded_fn (decl))
decl = get_first_fn (decl);
my_friendly_assert (DECL_P (decl), 20020908);
gcc_assert (DECL_P (decl));
/* Make a USING_DECL. */
return push_using_decl (scope, name);
......@@ -2517,12 +2516,11 @@ lookup_tag_reverse (tree type, tree name)
bool
is_ancestor (tree root, tree child)
{
my_friendly_assert ((TREE_CODE (root) == NAMESPACE_DECL
|| TREE_CODE (root) == FUNCTION_DECL
|| CLASS_TYPE_P (root)), 20030307);
my_friendly_assert ((TREE_CODE (child) == NAMESPACE_DECL
|| CLASS_TYPE_P (child)),
20030307);
gcc_assert ((TREE_CODE (root) == NAMESPACE_DECL
|| TREE_CODE (root) == FUNCTION_DECL
|| CLASS_TYPE_P (root)));
gcc_assert ((TREE_CODE (child) == NAMESPACE_DECL
|| CLASS_TYPE_P (child)));
/* The global namespace encloses everything. */
if (root == global_namespace)
......@@ -2602,7 +2600,7 @@ poplevel_class (void)
tree shadowed;
timevar_push (TV_NAME_LOOKUP);
my_friendly_assert (level != 0, 354);
gcc_assert (level != 0);
/* If we're leaving a toplevel class, cache its binding level. */
if (current_class_depth == 1)
......@@ -2648,7 +2646,7 @@ set_inherited_value_binding_p (cxx_binding *binding, tree decl,
context = CP_DECL_CONTEXT (OVL_CURRENT (decl));
else
{
my_friendly_assert (DECL_P (decl), 0);
gcc_assert (DECL_P (decl));
context = context_for_name_lookup (decl);
}
......@@ -2786,7 +2784,7 @@ push_class_level_binding (tree name, tree x)
POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, true);
/* Check for invalid member names. */
my_friendly_assert (TYPE_BEING_DEFINED (current_class_type), 20040713);
gcc_assert (TYPE_BEING_DEFINED (current_class_type));
/* We could have been passed a tree list if this is an ambiguous
declaration. If so, pull the declaration out because
check_template_shadow will not handle a TREE_LIST. */
......@@ -2940,7 +2938,7 @@ do_class_using_decl (tree decl)
name = DECL_NAME (get_first_fn (fns));
}
my_friendly_assert (TREE_CODE (name) == IDENTIFIER_NODE, 980716);
gcc_assert (TREE_CODE (name) == IDENTIFIER_NODE);
/* Dependent using decls have a NULL type, non-dependent ones have a
void type. */
......@@ -3085,8 +3083,7 @@ push_namespace (tree name)
/* We should not get here if the global_namespace is not yet constructed
nor if NAME designates the global namespace: The global scope is
constructed elsewhere. */
my_friendly_assert (global_namespace != NULL && name != global_scope_name,
20030531);
gcc_assert (global_namespace != NULL && name != global_scope_name);
if (anon)
{
......@@ -3147,7 +3144,7 @@ push_namespace (tree name)
void
pop_namespace (void)
{
my_friendly_assert (current_namespace != global_namespace, 20010801);
gcc_assert (current_namespace != global_namespace);
current_namespace = CP_DECL_CONTEXT (current_namespace);
/* The binding level is not popped, as it might be re-opened later. */
leave_scope ();
......@@ -3301,8 +3298,8 @@ add_using_namespace (tree user, tree used, bool indirect)
timevar_pop (TV_NAME_LOOKUP);
return;
}
my_friendly_assert (TREE_CODE (user) == NAMESPACE_DECL, 380);
my_friendly_assert (TREE_CODE (used) == NAMESPACE_DECL, 380);
gcc_assert (TREE_CODE (user) == NAMESPACE_DECL);
gcc_assert (TREE_CODE (used) == NAMESPACE_DECL);
/* Check if we already have this. */
t = purpose_member (used, DECL_NAMESPACE_USING (user));
if (t != NULL_TREE)
......@@ -3523,7 +3520,7 @@ ambiguous_decl (tree name, struct scope_binding *old, cxx_binding *new,
int flags)
{
tree val, type;
my_friendly_assert (old != NULL, 393);
gcc_assert (old != NULL);
/* Copy the value. */
val = new->value;
if (val)
......@@ -3646,7 +3643,7 @@ lookup_namespace_name (tree namespace, tree name)
struct scope_binding binding = EMPTY_SCOPE_BINDING;
timevar_push (TV_NAME_LOOKUP);
my_friendly_assert (TREE_CODE (namespace) == NAMESPACE_DECL, 370);
gcc_assert (TREE_CODE (namespace) == NAMESPACE_DECL);
if (TREE_CODE (name) == NAMESPACE_DECL)
/* This happens for A::B<int> when B is a namespace. */
......@@ -3671,7 +3668,7 @@ lookup_namespace_name (tree namespace, tree name)
name = DECL_NAME (name);
}
my_friendly_assert (TREE_CODE (name) == IDENTIFIER_NODE, 373);
gcc_assert (TREE_CODE (name) == IDENTIFIER_NODE);
if (!qualified_lookup_using_namespace (name, namespace, &binding, 0))
POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, error_mark_node);
......@@ -4181,8 +4178,7 @@ lookup_type_current_level (tree name)
tree t = NULL_TREE;
timevar_push (TV_NAME_LOOKUP);
my_friendly_assert (current_binding_level->kind != sk_namespace,
980716);
gcc_assert (current_binding_level->kind != sk_namespace);
if (REAL_IDENTIFIER_TYPE_VALUE (name) != NULL_TREE
&& REAL_IDENTIFIER_TYPE_VALUE (name) != global_type_node)
......@@ -4668,9 +4664,7 @@ maybe_process_template_type_declaration (tree type, int globalize,
{
maybe_check_template_type (type);
my_friendly_assert (IS_AGGR_TYPE (type)
|| TREE_CODE (type) == ENUMERAL_TYPE, 0);
gcc_assert (IS_AGGR_TYPE (type) || TREE_CODE (type) == ENUMERAL_TYPE);
if (processing_template_decl)
{
......
......@@ -714,7 +714,7 @@ cp_lexer_peek_nth_token (cp_lexer* lexer, size_t n)
cp_token *token;
/* N is 1-based, not zero-based. */
my_friendly_assert (n > 0, 20000224);
gcc_assert (n > 0);
/* Skip ahead from NEXT_TOKEN, reading more tokens as necessary. */
token = lexer->next_token;
......@@ -2272,7 +2272,7 @@ cp_parser_parse_and_diagnose_invalid_type_name (cp_parser *parser)
/* If we got here, this cannot be a valid variable declaration, thus
the cp_parser_id_expression must have resolved to a plain identifier
node (not a TYPE_DECL or TEMPLATE_ID_EXPR). */
my_friendly_assert (TREE_CODE (id) == IDENTIFIER_NODE, 20030203);
gcc_assert (TREE_CODE (id) == IDENTIFIER_NODE);
/* Emit a diagnostic for the invalid type. */
cp_parser_diagnose_invalid_type_name (parser, parser->scope, id);
/* Skip to the end of the declaration; there's no point in
......@@ -2668,9 +2668,8 @@ cp_parser_translation_unit (cp_parser* parser)
}
/* Make sure the declarator obstack was fully cleaned up. */
my_friendly_assert (obstack_next_free (&declarator_obstack) ==
declarator_obstack_base,
20040621);
gcc_assert (obstack_next_free (&declarator_obstack)
== declarator_obstack_base);
/* All went well. */
return success;
......@@ -8529,10 +8528,9 @@ cp_parser_template_id (cp_parser *parser,
{
/* If it's not a class-template or a template-template, it should be
a function-template. */
my_friendly_assert ((DECL_FUNCTION_TEMPLATE_P (template)
|| TREE_CODE (template) == OVERLOAD
|| BASELINK_P (template)),
20010716);
gcc_assert ((DECL_FUNCTION_TEMPLATE_P (template)
|| TREE_CODE (template) == OVERLOAD
|| BASELINK_P (template)));
template_id = lookup_template_function (template, arguments);
}
......@@ -14181,9 +14179,8 @@ cp_parser_lookup_name (cp_parser *parser, tree name,
return name;
if (BASELINK_P (name))
{
my_friendly_assert ((TREE_CODE (BASELINK_FUNCTIONS (name))
== TEMPLATE_ID_EXPR),
20020909);
gcc_assert (TREE_CODE (BASELINK_FUNCTIONS (name))
== TEMPLATE_ID_EXPR);
return name;
}
......@@ -14213,8 +14210,7 @@ cp_parser_lookup_name (cp_parser *parser, tree name,
/* By this point, the NAME should be an ordinary identifier. If
the id-expression was a qualified name, the qualifying scope is
stored in PARSER->SCOPE at this point. */
my_friendly_assert (TREE_CODE (name) == IDENTIFIER_NODE,
20000619);
gcc_assert (TREE_CODE (name) == IDENTIFIER_NODE);
/* Perform the lookup. */
if (parser->scope)
......@@ -14326,12 +14322,11 @@ cp_parser_lookup_name (cp_parser *parser, tree name,
return error_mark_node;
}
my_friendly_assert (DECL_P (decl)
|| TREE_CODE (decl) == OVERLOAD
|| TREE_CODE (decl) == SCOPE_REF
|| TREE_CODE (decl) == UNBOUND_CLASS_TEMPLATE
|| BASELINK_P (decl),
20000619);
gcc_assert (DECL_P (decl)
|| TREE_CODE (decl) == OVERLOAD
|| TREE_CODE (decl) == SCOPE_REF
|| TREE_CODE (decl) == UNBOUND_CLASS_TEMPLATE
|| BASELINK_P (decl));
/* If we have resolved the name of a member declaration, check to
see if the declaration is accessible. When the name resolves to
......@@ -15223,7 +15218,7 @@ cp_parser_late_parsing_for_member (cp_parser* parser, tree member_function)
/* There should not be any class definitions in progress at this
point; the bodies of members are only parsed outside of all class
definitions. */
my_friendly_assert (parser->num_classes_being_defined == 0, 20010816);
gcc_assert (parser->num_classes_being_defined == 0);
/* While we're parsing the member functions we might encounter more
classes. We want to handle them right away, but we don't want
them getting mixed up with functions that are currently in the
......
......@@ -264,11 +264,10 @@ finish_repo (void)
int
repo_emit_p (tree decl)
{
my_friendly_assert (TREE_PUBLIC (decl), 20040725);
my_friendly_assert (TREE_CODE (decl) == FUNCTION_DECL
|| TREE_CODE (decl) == VAR_DECL,
20040725);
my_friendly_assert (!DECL_REALLY_EXTERN (decl), 20040725);
gcc_assert (TREE_PUBLIC (decl));
gcc_assert (TREE_CODE (decl) == FUNCTION_DECL
|| TREE_CODE (decl) == VAR_DECL);
gcc_assert (!DECL_REALLY_EXTERN (decl));
/* When not using the repository, emit everything. */
if (!flag_use_repository)
......
......@@ -140,7 +140,7 @@ build_headof (tree exp)
tree offset;
tree index;
my_friendly_assert (TREE_CODE (type) == POINTER_TYPE, 20000112);
gcc_assert (TREE_CODE (type) == POINTER_TYPE);
type = TREE_TYPE (type);
if (!TYPE_POLYMORPHIC_P (type))
......@@ -364,7 +364,7 @@ get_tinfo_decl (tree type)
pushdecl_top_level_and_finish (d, NULL_TREE);
/* Add decl to the global array of tinfo decls. */
my_friendly_assert (unemitted_tinfo_decls != 0, 20030312);
gcc_assert (unemitted_tinfo_decls != 0);
VARRAY_PUSH_TREE (unemitted_tinfo_decls, d);
}
......@@ -1026,7 +1026,7 @@ typeinfo_in_lib_p (tree type)
static tree
get_pseudo_ti_init (tree type, tree var_desc)
{
my_friendly_assert (at_eof, 20021120);
gcc_assert (at_eof);
switch (TREE_CODE (type))
{
case OFFSET_TYPE:
......@@ -1274,7 +1274,7 @@ get_pseudo_ti_desc (tree type)
static void
create_tinfo_types (void)
{
my_friendly_assert (!ti_desc_type_node, 20020609);
gcc_assert (!ti_desc_type_node);
push_nested_namespace (abi_node);
......@@ -1436,7 +1436,7 @@ emit_tinfo_decl (tree decl)
int in_library = typeinfo_in_lib_p (type);
tree var_desc, var_init;
my_friendly_assert (DECL_TINFO_P (decl), 20030307);
gcc_assert (DECL_TINFO_P (decl));
if (in_library)
{
......
......@@ -148,7 +148,7 @@ lookup_base_r (tree binfo, tree base, base_access access,
bk = bk_proper_base;
/* Fall through. */
case bk_proper_base:
my_friendly_assert (found == bk_not_base, 20010723);
gcc_assert (found == bk_not_base);
found = bk;
break;
......@@ -217,7 +217,7 @@ lookup_base (tree t, tree base, base_access access, base_kind *kind_ptr)
*kind_ptr = bk_not_base;
return error_mark_node;
}
my_friendly_assert (TYPE_P (base), 20011127);
gcc_assert (TYPE_P (base));
if (!TYPE_P (t))
{
......@@ -436,7 +436,7 @@ lookup_field_1 (tree type, tree name, bool want_type)
#ifdef GATHER_STATISTICS
n_fields_searched++;
#endif /* GATHER_STATISTICS */
my_friendly_assert (DECL_P (field), 0);
gcc_assert (DECL_P (field));
if (DECL_NAME (field) == NULL_TREE
&& ANON_AGGR_TYPE_P (TREE_TYPE (field)))
{
......@@ -618,7 +618,7 @@ dfs_access_in_type (tree binfo, void *data)
else if (decl_access == access_private_node)
access = ak_private;
else
my_friendly_assert (false, 20030217);
gcc_unreachable ();
}
}
......@@ -1182,13 +1182,12 @@ build_baselink (tree binfo, tree access_binfo, tree functions, tree optype)
{
tree baselink;
my_friendly_assert (TREE_CODE (functions) == FUNCTION_DECL
|| TREE_CODE (functions) == TEMPLATE_DECL
|| TREE_CODE (functions) == TEMPLATE_ID_EXPR
|| TREE_CODE (functions) == OVERLOAD,
20020730);
my_friendly_assert (!optype || TYPE_P (optype), 20020730);
my_friendly_assert (TREE_TYPE (functions), 20020805);
gcc_assert (TREE_CODE (functions) == FUNCTION_DECL
|| TREE_CODE (functions) == TEMPLATE_DECL
|| TREE_CODE (functions) == TEMPLATE_ID_EXPR
|| TREE_CODE (functions) == OVERLOAD);
gcc_assert (!optype || TYPE_P (optype));
gcc_assert (TREE_TYPE (functions));
baselink = make_node (BASELINK);
TREE_TYPE (baselink) = TREE_TYPE (functions);
......@@ -1228,7 +1227,7 @@ lookup_member (tree xbasetype, tree name, int protect, bool want_type)
const char *errstr = 0;
my_friendly_assert (TREE_CODE (name) == IDENTIFIER_NODE, 20030624);
gcc_assert (TREE_CODE (name) == IDENTIFIER_NODE);
if (TREE_CODE (xbasetype) == TREE_BINFO)
{
......@@ -1237,7 +1236,7 @@ lookup_member (tree xbasetype, tree name, int protect, bool want_type)
}
else
{
my_friendly_assert (IS_AGGR_TYPE_CODE (TREE_CODE (xbasetype)), 20030624);
gcc_assert (IS_AGGR_TYPE_CODE (TREE_CODE (xbasetype)));
type = xbasetype;
xbasetype = NULL_TREE;
}
......@@ -1491,7 +1490,7 @@ adjust_result_of_qualified_name_lookup (tree decl,
{
tree base;
my_friendly_assert (CLASS_TYPE_P (context_class), 20020808);
gcc_assert (CLASS_TYPE_P (context_class));
/* Look for the QUALIFYING_SCOPE as a base of the CONTEXT_CLASS.
Because we do not yet know which function will be chosen by
......@@ -2505,11 +2504,11 @@ copied_binfo (tree binfo, tree here)
}
else
{
my_friendly_assert (BINFO_TYPE (here) == BINFO_TYPE (binfo), 20030202);
gcc_assert (BINFO_TYPE (here) == BINFO_TYPE (binfo));
result = here;
}
my_friendly_assert (result, 20030202);
gcc_assert (result);
return result;
}
......
......@@ -307,7 +307,7 @@ perform_or_defer_access_check (tree binfo, tree decl)
if (deferred_access_no_check)
return;
my_friendly_assert (TREE_CODE (binfo) == TREE_BINFO, 20030623);
gcc_assert (TREE_CODE (binfo) == TREE_BINFO);
ptr = VEC_last (deferred_access, deferred_access_stack);
......@@ -1249,7 +1249,7 @@ finish_parenthesized_expr (tree expr)
tree
finish_non_static_data_member (tree decl, tree object, tree qualifying_scope)
{
my_friendly_assert (TREE_CODE (decl) == FIELD_DECL, 20020909);
gcc_assert (TREE_CODE (decl) == FIELD_DECL);
if (!object)
{
......@@ -1497,7 +1497,7 @@ finish_stmt_expr_expr (tree expr, tree stmt_expr)
build_tree_list (NULL_TREE, expr),
type, LOOKUP_NORMAL);
expr = build_cplus_new (type, expr);
my_friendly_assert (TREE_CODE (expr) == TARGET_EXPR, 20030729);
gcc_assert (TREE_CODE (expr) == TARGET_EXPR);
}
}
......@@ -1582,7 +1582,7 @@ finish_stmt_expr (tree stmt_expr, bool has_no_scope)
the statement expression itself as the target's init
expr. Finally, return the target expression. */
tree init, target_expr = EXPR_STMT_EXPR (result_stmt);
my_friendly_assert (TREE_CODE (target_expr) == TARGET_EXPR, 20030729);
gcc_assert (TREE_CODE (target_expr) == TARGET_EXPR);
/* The initializer will be void if the initialization is done by
AGGR_INIT_EXPR; propagate that out to the statement-expression as
......@@ -1682,8 +1682,7 @@ finish_call_expr (tree fn, tree args, bool disallow_virtual, bool koenig_p)
return error_mark_node;
/* ARGS should be a list of arguments. */
my_friendly_assert (!args || TREE_CODE (args) == TREE_LIST,
20020712);
gcc_assert (!args || TREE_CODE (args) == TREE_LIST);
orig_fn = fn;
orig_args = args;
......@@ -1858,7 +1857,7 @@ finish_pseudo_destructor_expr (tree object, tree scope, tree destructor)
if (destructor == error_mark_node)
return error_mark_node;
my_friendly_assert (TYPE_P (destructor), 20010905);
gcc_assert (TYPE_P (destructor));
if (!processing_template_decl)
{
......@@ -1998,7 +1997,7 @@ finish_template_template_parm (tree aggr, tree identifier)
DECL_ARTIFICIAL (decl) = 1;
end_template_decl ();
my_friendly_assert (DECL_TEMPLATE_PARMS (tmpl), 20010110);
gcc_assert (DECL_TEMPLATE_PARMS (tmpl));
return finish_template_type_parm (aggr, tmpl);
}
......@@ -2128,7 +2127,7 @@ finish_member_declaration (tree decl)
return;
/* We should see only one DECL at a time. */
my_friendly_assert (TREE_CHAIN (decl) == NULL_TREE, 0);
gcc_assert (TREE_CHAIN (decl) == NULL_TREE);
/* Set up access control for DECL. */
TREE_PRIVATE (decl)
......@@ -2856,7 +2855,7 @@ emit_associated_thunks (tree fn)
}
}
else
my_friendly_assert (!DECL_THUNKS (thunk), 20031023);
gcc_assert (!DECL_THUNKS (thunk));
}
}
}
......
......@@ -319,7 +319,7 @@ build_target_expr_with_type (tree init, tree type)
{
tree slot;
my_friendly_assert (!VOID_TYPE_P (type), 20040130);
gcc_assert (!VOID_TYPE_P (type));
if (TREE_CODE (init) == TARGET_EXPR)
return init;
......@@ -347,7 +347,7 @@ force_target_expr (tree type, tree init)
{
tree slot;
my_friendly_assert (!VOID_TYPE_P (type), 20040130);
gcc_assert (!VOID_TYPE_P (type));
slot = build_local_temp (type);
return build_target_expr (slot, init);
......@@ -606,8 +606,8 @@ copy_binfo (tree binfo, tree type, tree t, tree *igo_prev, int virt)
int ix;
tree base_binfo;
my_friendly_assert (!BINFO_DEPENDENT_BASE_P (binfo), 20040712);
my_friendly_assert (type == BINFO_TYPE (binfo), 20040714);
gcc_assert (!BINFO_DEPENDENT_BASE_P (binfo));
gcc_assert (type == BINFO_TYPE (binfo));
BINFO_OFFSET (new_binfo) = BINFO_OFFSET (binfo);
BINFO_VIRTUALS (new_binfo) = BINFO_VIRTUALS (binfo);
......@@ -620,7 +620,7 @@ copy_binfo (tree binfo, tree type, tree t, tree *igo_prev, int virt)
{
tree new_base_binfo;
my_friendly_assert (!BINFO_DEPENDENT_BASE_P (base_binfo), 20040713);
gcc_assert (!BINFO_DEPENDENT_BASE_P (base_binfo));
new_base_binfo = copy_binfo (base_binfo, BINFO_TYPE (base_binfo),
t, igo_prev,
BINFO_VIRTUAL_P (base_binfo));
......@@ -840,7 +840,7 @@ really_overloaded_fn (tree x)
tree
get_first_fn (tree from)
{
my_friendly_assert (is_overloaded_fn (from), 9);
gcc_assert (is_overloaded_fn (from));
/* A baselink is also considered an overloaded function. */
if (BASELINK_P (from))
from = BASELINK_FUNCTIONS (from);
......@@ -1584,7 +1584,7 @@ cp_tree_equal (tree t1, tree t2)
return same_type_p (t1, t2);
}
my_friendly_assert (0, 20030617);
gcc_unreachable ();
return false;
}
......
......@@ -262,14 +262,12 @@ type_after_usual_arithmetic_conversions (tree t1, tree t2)
tree attributes;
/* FIXME: Attributes. */
my_friendly_assert (ARITHMETIC_TYPE_P (t1)
|| TREE_CODE (t1) == COMPLEX_TYPE
|| TREE_CODE (t1) == ENUMERAL_TYPE,
19990725);
my_friendly_assert (ARITHMETIC_TYPE_P (t2)
|| TREE_CODE (t2) == COMPLEX_TYPE
|| TREE_CODE (t2) == ENUMERAL_TYPE,
19990725);
gcc_assert (ARITHMETIC_TYPE_P (t1)
|| TREE_CODE (t1) == COMPLEX_TYPE
|| TREE_CODE (t1) == ENUMERAL_TYPE);
gcc_assert (ARITHMETIC_TYPE_P (t2)
|| TREE_CODE (t2) == COMPLEX_TYPE
|| TREE_CODE (t2) == ENUMERAL_TYPE);
/* In what follows, we slightly generalize the rules given in [expr] so
as to deal with `long long' and `complex'. First, merge the
......@@ -928,7 +926,7 @@ comptypes (tree t1, tree t2, int strict)
if (t1 == error_mark_node || t2 == error_mark_node)
return false;
my_friendly_assert (TYPE_P (t1) && TYPE_P (t2), 20030623);
gcc_assert (TYPE_P (t1) && TYPE_P (t2));
/* TYPENAME_TYPEs should be resolved if the qualifying scope is the
current instantiation. */
......@@ -1218,7 +1216,7 @@ cxx_sizeof_or_alignof_type (tree type, enum tree_code op, bool complain)
tree value;
const char *op_name;
my_friendly_assert (op == SIZEOF_EXPR || op == ALIGNOF_EXPR, 20020720);
gcc_assert (op == SIZEOF_EXPR || op == ALIGNOF_EXPR);
if (type == error_mark_node)
return error_mark_node;
......@@ -1441,7 +1439,7 @@ perform_integral_promotions (tree expr)
tree promoted_type;
type = TREE_TYPE (expr);
my_friendly_assert (INTEGRAL_OR_ENUMERATION_TYPE_P (type), 20030703);
gcc_assert (INTEGRAL_OR_ENUMERATION_TYPE_P (type));
promoted_type = type_promotes_to (type);
if (type != promoted_type)
expr = cp_convert (promoted_type, expr);
......@@ -1595,8 +1593,7 @@ build_class_member_access_expr (tree object, tree member,
if (TREE_CODE (member) == PSEUDO_DTOR_EXPR)
return member;
my_friendly_assert (DECL_P (member) || BASELINK_P (member),
20020801);
gcc_assert (DECL_P (member) || BASELINK_P (member));
/* [expr.ref]
......@@ -1698,8 +1695,7 @@ build_class_member_access_expr (tree object, tree member,
/*nonnull=*/1);
/* If we found the base successfully then we should be able
to convert to it successfully. */
my_friendly_assert (object != error_mark_node,
20020801);
gcc_assert (object != error_mark_node);
}
/* Complain about other invalid uses of offsetof, even though they will
......@@ -1909,9 +1905,7 @@ finish_class_member_access_expr (tree object, tree name)
if (BASELINK_P (name))
{
/* A member function that has already been looked up. */
my_friendly_assert ((TREE_CODE (BASELINK_FUNCTIONS (name))
== TEMPLATE_ID_EXPR),
20020805);
gcc_assert (TREE_CODE (BASELINK_FUNCTIONS (name)) == TEMPLATE_ID_EXPR);
member = name;
}
else
......@@ -1940,12 +1934,10 @@ finish_class_member_access_expr (tree object, tree name)
or a BIT_NOT_EXPR. */
scope = TREE_OPERAND (name, 0);
name = TREE_OPERAND (name, 1);
my_friendly_assert ((CLASS_TYPE_P (scope)
|| TREE_CODE (scope) == NAMESPACE_DECL),
20020804);
my_friendly_assert ((TREE_CODE (name) == IDENTIFIER_NODE
|| TREE_CODE (name) == BIT_NOT_EXPR),
20020804);
gcc_assert (CLASS_TYPE_P (scope)
|| TREE_CODE (scope) == NAMESPACE_DECL);
gcc_assert (TREE_CODE (name) == IDENTIFIER_NODE
|| TREE_CODE (name) == BIT_NOT_EXPR);
/* If SCOPE is a namespace, then the qualified name does not
name a member of OBJECT_TYPE. */
......@@ -2032,7 +2024,7 @@ build_ptrmemfunc_access_expr (tree ptrmem, tree member_name)
routine directly because it expects the object to be of class
type. */
ptrmem_type = TREE_TYPE (ptrmem);
my_friendly_assert (TYPE_PTRMEMFUNC_P (ptrmem_type), 20020804);
gcc_assert (TYPE_PTRMEMFUNC_P (ptrmem_type));
member = lookup_member (ptrmem_type, member_name, /*protect=*/0,
/*want_type=*/false);
member_type = cp_build_qualified_type (TREE_TYPE (member),
......@@ -4091,9 +4083,8 @@ build_unary_op (enum tree_code code, tree xarg, int noconvert)
/* We can only get here with a single static member
function. */
my_friendly_assert (TREE_CODE (fn) == FUNCTION_DECL
&& DECL_STATIC_FUNCTION_P (fn),
20030906);
gcc_assert (TREE_CODE (fn) == FUNCTION_DECL
&& DECL_STATIC_FUNCTION_P (fn));
mark_used (fn);
addr = build_address (fn);
if (TREE_SIDE_EFFECTS (TREE_OPERAND (arg, 0)))
......@@ -4208,7 +4199,7 @@ unary_complex_lvalue (enum tree_code code, tree arg)
{
tree t;
my_friendly_assert (TREE_CODE (arg) != SCOPE_REF, 313);
gcc_assert (TREE_CODE (arg) != SCOPE_REF);
if (TREE_CODE (arg) != OFFSET_REF)
return 0;
......@@ -4312,10 +4303,10 @@ cxx_mark_addressable (tree exp)
case VAR_DECL:
/* Caller should not be trying to mark initialized
constant fields addressable. */
my_friendly_assert (DECL_LANG_SPECIFIC (x) == 0
|| DECL_IN_AGGR_P (x) == 0
|| TREE_STATIC (x)
|| DECL_EXTERNAL (x), 314);
gcc_assert (DECL_LANG_SPECIFIC (x) == 0
|| DECL_IN_AGGR_P (x) == 0
|| TREE_STATIC (x)
|| DECL_EXTERNAL (x));
/* Fall through. */
case CONST_DECL:
......@@ -5138,8 +5129,7 @@ build_modify_expr (tree lhs, enum tree_code modifycode, tree rhs)
value with the RHS producing the value we should actually
store into the LHS. */
my_friendly_assert (!PROMOTES_TO_AGGR_TYPE (lhstype, REFERENCE_TYPE),
978652);
gcc_assert (!PROMOTES_TO_AGGR_TYPE (lhstype, REFERENCE_TYPE));
lhs = stabilize_reference (lhs);
newrhs = cp_build_binary_op (modifycode, lhs, rhs);
if (newrhs == error_mark_node)
......@@ -5152,9 +5142,8 @@ build_modify_expr (tree lhs, enum tree_code modifycode, tree rhs)
/* Now it looks like a plain assignment. */
modifycode = NOP_EXPR;
}
my_friendly_assert (TREE_CODE (lhstype) != REFERENCE_TYPE, 20011220);
my_friendly_assert (TREE_CODE (TREE_TYPE (newrhs)) != REFERENCE_TYPE,
20011220);
gcc_assert (TREE_CODE (lhstype) != REFERENCE_TYPE);
gcc_assert (TREE_CODE (TREE_TYPE (newrhs)) != REFERENCE_TYPE);
}
/* The left-hand side must be an lvalue. */
......@@ -5467,10 +5456,8 @@ build_ptrmemfunc (tree type, tree pfn, int force)
}
/* Just adjust the DELTA field. */
my_friendly_assert
(same_type_ignoring_top_level_qualifiers_p (TREE_TYPE (delta),
ptrdiff_type_node),
20030727);
gcc_assert (same_type_ignoring_top_level_qualifiers_p
(TREE_TYPE (delta), ptrdiff_type_node));
if (TARGET_PTRMEMFUNC_VBIT_LOCATION == ptrmemfunc_vbit_in_delta)
n = cp_build_binary_op (LSHIFT_EXPR, n, integer_one_node);
delta = cp_build_binary_op (PLUS_EXPR, delta, n);
......@@ -5490,7 +5477,7 @@ build_ptrmemfunc (tree type, tree pfn, int force)
return instantiate_type (type, pfn, tf_error | tf_warning);
fn = TREE_OPERAND (pfn, 0);
my_friendly_assert (TREE_CODE (fn) == FUNCTION_DECL, 0);
gcc_assert (TREE_CODE (fn) == FUNCTION_DECL);
return make_ptrmem_cst (to_type, fn);
}
......@@ -5508,7 +5495,7 @@ expand_ptrmemfunc_cst (tree cst, tree *delta, tree *pfn)
tree fn = PTRMEM_CST_MEMBER (cst);
tree ptr_class, fn_class;
my_friendly_assert (TREE_CODE (fn) == FUNCTION_DECL, 0);
gcc_assert (TREE_CODE (fn) == FUNCTION_DECL);
/* The class that the function belongs to. */
fn_class = DECL_CONTEXT (fn);
......@@ -5916,7 +5903,7 @@ check_return_expr (tree retval)
return value, the named return value is used. */
result = DECL_RESULT (current_function_decl);
valtype = TREE_TYPE (result);
my_friendly_assert (valtype != NULL_TREE, 19990924);
gcc_assert (valtype != NULL_TREE);
fn_returns_value_p = !VOID_TYPE_P (valtype);
if (!retval && DECL_NAME (result) && fn_returns_value_p)
retval = result;
......
......@@ -179,7 +179,7 @@ complete_type_check_abstract (tree type)
struct pending_abstract_type *pat;
location_t cur_loc = input_location;
my_friendly_assert (COMPLETE_TYPE_P (type), 20040620_3);
gcc_assert (COMPLETE_TYPE_P (type));
if (!abstract_pending_vars)
return;
......@@ -190,7 +190,7 @@ complete_type_check_abstract (tree type)
if (!slot)
return;
pat = (struct pending_abstract_type*)*slot;
my_friendly_assert (pat, 20040620_2);
gcc_assert (pat);
/* If the type is not abstract, do not do anything. */
if (CLASSTYPE_PURE_VIRTUALS (type))
......@@ -210,7 +210,7 @@ complete_type_check_abstract (tree type)
element: it will issue a diagostic if the type is abstract. */
while (pat)
{
my_friendly_assert (type == pat->type, 20040620_4);
gcc_assert (type == pat->type);
/* Tweak input_location so that the diagnostic appears at the correct
location. Notice that this is only needed if the decl is an
......@@ -252,9 +252,8 @@ abstract_virtuals_error (tree decl, tree type)
void **slot;
struct pending_abstract_type *pat;
my_friendly_assert (!decl || (DECL_P (decl)
|| TREE_CODE (decl) == IDENTIFIER_NODE),
20040620_1);
gcc_assert (!decl || DECL_P (decl)
|| TREE_CODE (decl) == IDENTIFIER_NODE);
if (!abstract_pending_vars)
abstract_pending_vars = htab_create_ggc (31, &pat_calc_hash,
......@@ -888,12 +887,9 @@ process_init_constructor (tree type, tree init, tree* elts)
TREE_VALUE (tail), &tail1);
if (next1 == error_mark_node)
return next1;
my_friendly_assert
(same_type_ignoring_top_level_qualifiers_p
(TREE_TYPE (type), TREE_TYPE (next1)),
981123);
my_friendly_assert (tail1 == 0
|| TREE_CODE (tail1) == TREE_LIST, 319);
gcc_assert (same_type_ignoring_top_level_qualifiers_p
(TREE_TYPE (type), TREE_TYPE (next1)));
gcc_assert (!tail1 || TREE_CODE (tail1) == TREE_LIST);
if (tail == tail1 && len < 0)
{
error ("non-empty initializer for array of empty elements");
......@@ -992,8 +988,7 @@ process_init_constructor (tree type, tree init, tree* elts)
next1 = digest_init (TREE_TYPE (field),
TREE_VALUE (tail), &tail1);
my_friendly_assert (tail1 == 0
|| TREE_CODE (tail1) == TREE_LIST, 320);
gcc_assert (!tail1 || TREE_CODE (tail1) == TREE_LIST);
tail = tail1;
}
else
......@@ -1463,7 +1458,7 @@ add_exception_specifier (tree list, tree spec, int complain)
if (spec == error_mark_node)
return list;
my_friendly_assert (spec && (!list || TREE_VALUE (list)), 19990317);
gcc_assert (spec && (!list || TREE_VALUE (list)));
/* [except.spec] 1, type in an exception specifier shall not be
incomplete, or pointer or ref to incomplete other than pointer
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment