Commit Graph

1567 Commits

Author SHA1 Message Date
Mark Mitchell
7dc5bd62ab semantics.c (finish_asm_statement): Apply decay conversions to input operands.
* semantics.c (finish_asm_statement): Apply decay conversions to
        input operands.

From-SVN: r27617
1999-06-19 17:56:56 -06:00
Mark Mitchell
0045e0bc3c decl.c (expand_static_init): When building an anonymous function for use with atexit...
* decl.c (expand_static_init): When building an anonymous function
	for use with atexit, compute its body before and after entering
	the function.
	* error.c (dump_expr): Handle BIND_EXPR, LOOP_EXPR, and
	EXIT_EXPR.

From-SVN: r27612
1999-06-19 11:11:43 +00:00
Mark Mitchell
0b8a1e58d9 init.c (expand_aggr_vbase_init): Add flag parameter.
* init.c (expand_aggr_vbase_init): Add flag parameter.
	(build_partial_cleanup_for): Remove, inlining into ..
	(expand_cleanup_for_base): ... here.  Take flag parameter.
	(emit_base_init): Pass the in_chrg parameter to
	emit_aggr_vbase_init.
	(emit_aggr_vbase_init): Pass it to expand_cleanup_for_base.

From-SVN: r27600
1999-06-18 20:35:56 +00:00
Mark Mitchell
1b5f5f763a decl2.c (import_export_decl): Use same_type_p, rather than relying on pointer-equality for types.
* decl2.c (import_export_decl): Use same_type_p, rather than
	relying on pointer-equality for types.
	* method.c (do_build_copy_constructor): Simplify.

From-SVN: r27555
1999-06-16 17:48:05 +00:00
Mark Mitchell
4e61a9695a call.c (build_method_call): Remove bogus code for two-argument delete.
* call.c (build_method_call): Remove bogus code for two-argument
	delete.
	* init.c (build_new_1): Expand on comment, and remove dead code.

From-SVN: r27547
1999-06-16 11:24:10 +00:00
Mark Mitchell
f33e32a8cc init.c (expand_cleanup_for_base): New function, split out from ...
* init.c (expand_cleanup_for_base): New function, split out
	from ...
	(emit_base_init): Here.
	(expand_aggr_vbase_init): Use it.

From-SVN: r27543
1999-06-16 10:15:35 +00:00
Mark Mitchell
3f1892e165 cp-tree.h (class_cache_firstobj): Declare.
* cp-tree.h (class_cache_firstobj): Declare.
	(maybe_push_cache_obstack): Rename to push_cache_obstack.
	* class.c (permanent_obstack): Remove declaration.
	(class_cache_firstobj): Make it global.
	(add_method): Don't use permanent_obstack directly.
	(pushclass): Only free the class_cache_obstack if we know how far
	back to free it.
	(maybe_push_cache_obstack): Rename to push_cache_obstack.
	* decl.c: Remove dead comment.
	(saved_scope): Add class_cache_firstobj.
	(push_to_top_level): Save it.
	(pop_from_top_level): Restore it.
	(push_class_level_binding): Use push_cache_obstack, not
	maybe_push_cache_obstack.
	* search.c (push_class_decls): Likewise.

From-SVN: r27534
1999-06-15 16:42:46 +00:00
Martin v. Löwis
92da7074de pt.c (tsubst_friend_function): Push into namespace of friend function before pushdecl'ing it.
* pt.c (tsubst_friend_function): Push into namespace of friend
	function before pushdecl'ing it.

From-SVN: r27520
1999-06-14 15:56:12 +00:00
Nathan Sidwell
8be0a93054 * call.c (build_new_op): Remove REF_BIND from all operands.
From-SVN: r27510
1999-06-14 02:44:17 +00:00
Alexandre Oliva
5355deec1f init.c (build_new_1): Look up operator delete even if there was no explicit new placement.
* init.c (build_new_1): Look up operator delete even if there was
no explicit new placement.

From-SVN: r27502
1999-06-13 01:17:12 +00:00
Nathan Sidwell
4cfbc546d4 except.c (complete_ptr_ref_or_void_ptr_p): New function, broken out of ...
* except.c (complete_ptr_ref_or_void_ptr_p): New function, broken out
	of ...
	(build_throw): ... here. Call it.
	(process_start_catch_block): Call it.

From-SVN: r27424
1999-06-08 05:29:05 +00:00
Mark Mitchell
bfec1a842f search.c (convert_pointer_to_single_level): Reimplement without using get_binfo.
* search.c (convert_pointer_to_single_level): Reimplement without
	using get_binfo.

From-SVN: r27394
1999-06-07 13:28:06 +00:00
Dave Brolley
cd28936cf0 lex.c (real_yylex): Replace unused bytes from bad multibyte char.
1999-06-07  Dave Brolley  <brolley@cygnus.com>
	* lex.c (real_yylex): Replace unused bytes from bad multibyte char.
	* input.c (putback_buffer): New structure type.
	(putback): Replaces putback_char member.
	(putback): Replaces putback_char static variable.
	(feed_input): Use putback.
	(end_input): Use putback.
	(sub_getch): Use putback.
	(put_back): Use putback.

From-SVN: r27392
1999-06-07 07:10:29 -04:00
Mark Mitchell
9223feaacb method.c (is_back_referenceable_type): Back-reference bools when not squangling.
* method.c (is_back_referenceable_type): Back-reference bools when
	not squangling.

[[Split portion of a mixed commit.]]

From-SVN: r27382.2
1999-06-06 11:06:53 +00:00
Mark Mitchell
29bbeb1c2b * decl.c (grokdeclarator): Fix typo in last change.
From-SVN: r27368
1999-06-05 11:03:56 +00:00
Jason Merrill
ecfa9fccd5 semantics.c (finish_if_stmt_cond): Copy cond to permanent_obstack.
* semantics.c (finish_if_stmt_cond): Copy cond to permanent_obstack.
	(finish_while_stmt_cond, finish_do_stmt, finish_for_cond): Likewise.

From-SVN: r27348
1999-06-03 23:45:57 -04:00
Nathan Sidwell
980c394cc7 * except.c (build_throw): Check throw expression validity.
From-SVN: r27344
1999-06-04 01:31:42 +00:00
Mark Mitchell
b89c5a7b53 decl.c (grokdeclarator): Don't treat arbitrary types as unsigned just because flag_signed_bitfields is false.
* decl.c (grokdeclarator): Don't treat arbitrary types as unsigned
	just because flag_signed_bitfields is false.

From-SVN: r27328
1999-06-03 10:07:18 +00:00
Nathan Sidwell
b4f70b3d42 semantics.c (begin_class_definition): Update the struct's location here ...
* semantics.c (begin_class_definition): Update the struct's
	location here ...
	* class.c (finish_struct): ... rather than here.
	* decl.c (make_typename_type): Don't rely on uninitialized
	variable.

From-SVN: r27326
1999-06-03 07:16:15 +00:00
Kaveh R. Ghazi
b2d352ba5a * Makefile.in (ALL_CFLAGS): Add '-W -Wall'.
From-SVN: r27274
1999-05-31 06:39:48 +00:00
Mark Mitchell
e73acc3110 tree.c (build_cplus_array_type_1): Use push_obstacks_nochange and friends rather than messing with current_obstack...
* tree.c (build_cplus_array_type_1): Use push_obstacks_nochange
	and friends rather than messing with current_obstack directly.
	(cp_build_qualified_type_real): Rework ARRAY_TYPE
	allocation to match practice throughout the rest of the
	compiler.

From-SVN: r27265
1999-05-31 00:27:55 +00:00
Mark Mitchell
db3626d11f tree.c (cp_build_qualified_type_real): Rework ARRAY_TYPE allocation to match practice throughout the rest of the compiler.
* tree.c (cp_build_qualified_type_real): Rework ARRAY_TYPE
	allocation to match practice throughout the rest of the
	compiler.

From-SVN: r27264
1999-05-31 00:25:56 +00:00
Mark Mitchell
f6a7cfd28d lex.c (make_lang_type): Create TYPE_BINFO for TEMPLATE_TYPE_PARMs just like for non-template types.
* lex.c (make_lang_type): Create TYPE_BINFO for
	TEMPLATE_TYPE_PARMs just like for non-template types.

From-SVN: r27259
1999-05-30 21:50:51 +00:00
Mark Mitchell
3e41d13b03 decl.c (start_decl): Move checks on initialization to ...
* decl.c (start_decl): Move checks on initialization to ...
	(cp_finish_decl): Here.  Tidy formatting slightly.

From-SVN: r27252
1999-05-30 14:41:33 +00:00
Mark Mitchell
263505afaf decl.c (add_binding): Don't complain about a redeclaration of a semantically identical typedef in a...
* decl.c (add_binding): Don't complain about a redeclaration of a
	semantically identical typedef in a local scope.

From-SVN: r27213
1999-05-28 02:37:13 +00:00
Nathan Sidwell
6ab5c7408e decl.c (complete_array_type): Allocate off same obstack.
* decl.c (complete_array_type): Allocate off same obstack. Fix
	DO_DEFAULT comment to match reality.
	* friend.c (make_friend_class): Fix diagnostic typo.

From-SVN: r27210
1999-05-28 01:56:31 +00:00
Mark Mitchell
f30c84c966 decl.c (lookup_namespace_name): Handle getting a TEMPLATE_ID_EXPR.
* decl.c (lookup_namespace_name): Handle getting a
	TEMPLATE_ID_EXPR.
	(expand_static_init): Don't call pushdecl for implicitly declared
	`atexit' used to register destructors.

From-SVN: r27207
1999-05-28 00:20:07 +00:00
Mark Mitchell
3ebc5c52e8 class.c (finish_vtbls): Copy BINFO_VIRTUALs before using it to intialize a vtable.
* class.c (finish_vtbls): Copy BINFO_VIRTUALs before using it to
	intialize a vtable.
	* cp-tree.h (NAMESPACE_LEVEL): Reformat.
	(lang_decl_flags): Document MEMFUNC_POINTER_TO.  Save four bytes
	by combining TEMPLATE_INFO and LEVEL into a single union.
	(DECL_TEMPLATE_INFO): Reformat.
	(DECL_SAVED_TREE): Document.
	(DECL_TEMPLATE_INJECT): Remove.
	* class.c (finish_struct): Remove code to deal with
	DECL_TEMPLATE_INJECT.
	* decl.c (maybe_process_template_type_declaration): Handle all new
	types in templates uniformly.
	* method.c (bulid_overload_identifier): Use CP_DECL_CONTEXT, not
	DECL_CONTEXT.
	* pt.c (lookup_template_class): Inject template instantiations of
	forward-declarations.
	(instantiate_class_template): Remove code processing
	DECL_TEMPLATE_INJECT.
	* pt.c (lookup_template_class): Tweak lookup to find member
	templates.
	* pt.c (tsubst_expr, case ASM_STMT): Don't tsubst into
	ASM_CV_QUAL.
	* semantics.c (finish_asm_stmt): Make strings permanent if they're
	used in a template.

From-SVN: r27144
1999-05-25 15:31:38 +00:00
Jason Merrill
3e0b47108c typeck.c (casts_away_constness, [...]): Strip both parts of pointer to data member types.
* typeck.c (casts_away_constness, casts_away_constness_r): Strip both
	parts of pointer to data member types.

From-SVN: r27138
1999-05-25 07:55:58 -04:00
Mark Mitchell
5e65d3ee9a decl2.c (mark_vtable_entries): Don't make a copy of a function, and then make it look like `abort'.
* decl2.c (mark_vtable_entries): Don't make a copy of a function,
	and then make it look like `abort'.  Just use `abort' instead.

From-SVN: r27131
1999-05-24 23:38:55 +00:00
Mark Mitchell
af7b990290 typeck.c (build_static_cast): Don't allow static_casts that cast away constness.
* typeck.c (build_static_cast): Don't allow static_casts that cast
	away constness.
	(casts_away_constness_r): New function.
	(casts_away_constness): Likewise.

From-SVN: r27128
1999-05-24 15:26:25 +00:00
Mark Mitchell
8bcc97de27 decl.c (lookup_tag): Remove code no longer needed after name-lookup improvements.
* decl.c (lookup_tag): Remove code no longer needed after
	name-lookup improvements.
	* decl2.c (handle_class_head): Make error-recovery more robust.
	* friend.c (make_friend_class): Reject templated typename types.
	* lex.c (is_global): A template parameter isn't global.
	* parse.y (class_head): Robustify.
	* parse.c: Regenerated.

From-SVN: r27117
1999-05-24 00:47:01 +00:00
Mark Mitchell
4699c56180 pt.c (for_each_template_parm): Walk into TYPENAME_TYPEs, INDIRECT_REFs, and COMPONENT_REFs.
* pt.c (for_each_template_parm): Walk into TYPENAME_TYPEs,
	INDIRECT_REFs, and COMPONENT_REFs.  Handle FIELD_DECLs.

From-SVN: r27108
1999-05-22 19:00:23 +00:00
Mark Mitchell
61fc8c9e2b cp-tree.h (push_nested_namespace): Declare.
* cp-tree.h (push_nested_namespace): Declare.
	(pop_nested_namespace): Likewise.
	* decl.c (push_nested_namespace): New function.
	(pop_nested_namespace): Likewise.
	* pt.c (instantiate_class_template): Use them.

From-SVN: r27103
1999-05-22 14:26:55 +00:00
Mark Mitchell
9dd03dd98b * tree.c (mapcar): Handle LVALUE_EXPR.
From-SVN: r27101
1999-05-22 11:24:43 +00:00
Mark Mitchell
b928a6517e cp-tree.h (cplus_expand_constant): Declare.
* cp-tree.h (cplus_expand_constant): Declare.
	* cvt.c (convert_to_pointer): Expand PTRMEM_CSTs when they're
	converted from one pointer-to-object type to another.
	* expr.c (cplus_expand_constant): Don't make it static.
	* typeck.c (build_component_ref): Don't crash when presented with
	a component which is a TEMPLATE_DECL.
	(build_ptrmemfunc): Tidy.  Clarify comment.  Make sure that even a
	cast from a pointer-to-member constant to its own type does not
	result in a valid non-type template argument.

From-SVN: r27092
1999-05-22 01:30:11 +00:00
Mark Mitchell
adecb3f41f Make-lang.in (cc1plus): Make it depend on gxx.gperf.
* Make-lang.in (cc1plus): Make it depend on gxx.gperf.
	* cp-tree.h: Fix typo in documentation on pointers-to-members.
	(cp_build_qualified_type): Make it a macro.
	(cp_build_qualified_type_real): Declare.
	* decl.c (grokdeclarator): Remove misleading comment.  Avoid
	problem with template parameters and restrict-qualification.
	* gxx.gperf: Replace NORID with RID_UNUSED throughout.
	* hash.h: Regenerated.
	* lex.h (rid): Move RID_FIRST_MODIFIER and RID_LAST_MODIFIER into
	the enumeration.
	(NORID): Remove definition.
	* pt.c (tsubst_aggr_type): Use cp_build_qualified_type_real.
	(tsubst): Likewise.  Remove special handling for FUNCTION_TYPEs.
	(fn_type_unification): Check that the function type resulting from
	the deduction is legal.
	(check_cv_quals_for_unify): Don't handle FUNCTION_TYPEs specially.
	(unify): Use cp_build_qualified_type_real.
	* tree.c (build_cplus_array_type_1): Handle error_marks as inputs.
	(cp_build_qualified_type): Rename to ...
	(cp_build_qualified_type_real): Add additional COMPLAIN parameter
	and modify appropriately.

Co-Authored-By: Nathan Sidwell <nathan@acm.org>

From-SVN: r27086
1999-05-21 15:55:56 +00:00
Mark Mitchell
7133357a34 typeck.c (build_ptrmemfunc): Handle PTRMEM_CSTs carefully to reveal optimization opportunities.
* typeck.c (build_ptrmemfunc): Handle PTRMEM_CSTs carefully to
	reveal optimization opportunities.

From-SVN: r27084
1999-05-21 15:42:55 +00:00
Mark Mitchell
ef6372557a pt.c (tsubst): Don't issue error messages when we're not complaining...
* pt.c (tsubst): Don't issue error messages when we're not
	complaining, even if we see a qualified function type.
	(check_cv_quals_for_unify): Don't allow a qualified function
	type.

From-SVN: r27080
1999-05-21 09:55:50 +00:00
Jason Merrill
d08940b2c2 class.c (instantiate_type): Downgrade errors for object-dependent memfn refs to pedwarn.
* class.c (instantiate_type): Downgrade errors for object-dependent
	memfn refs to pedwarn.

From-SVN: r27072
1999-05-20 16:19:42 -04:00
Mark Mitchell
e8ea7036e9 decl.c (grokdeclarator): Don't treat [] as indicating a zero-sized array in a typedef.
* decl.c (grokdeclarator): Don't treat [] as indicating a
	zero-sized array in a typedef.

From-SVN: r27070
1999-05-20 18:10:28 +00:00
Mark Mitchell
f0bcd16877 call.c (build_object_call): Don't look at DECL_NAME for a type.
* call.c (build_object_call): Don't look at DECL_NAME for a type.
	(pt.c): Or CP_TYPE_QUALS for an ERROR_MARK.
	(typeck.c): Or TYPE_MAIN_VARIANT for a type.

From-SVN: r27068
1999-05-20 17:19:29 +00:00
Mark Mitchell
b886540796 pt.c (for_each_template_parm): Rework to match documentation.
* pt.c (for_each_template_parm): Rework to match documentation.
	Don't be fooled by a COMPONENT_REF with no TREE_TYPE.

From-SVN: r27066
1999-05-20 14:58:40 +00:00
Jason Merrill
6d813d4d85 class.c (finish_struct_1): Still check for ANON_AGGR_TYPE_P.
* class.c (finish_struct_1): Still check for ANON_AGGR_TYPE_P.
	* class.c (finish_base_struct): Allow non-COM bases for COM classes
	except at the leftmost position.
	(modify_one_vtable, fixup_vtable_deltas1, override_one_vtable):
	Pass the binfo's class, not the most derived, to skip_rtti_stuff.
	* search.c (get_abstract_virtuals, expand_upcast_fixups): Likewise.

From-SVN: r27065
1999-05-20 08:21:53 -04:00
Jason Merrill
06126ca285 tree.c (lvalue_p_1): A NOP_EXPR can be an lvalue.
* tree.c (lvalue_p_1): A NOP_EXPR can be an lvalue.
	(build_cplus_new): Make sure that what we return is of the right type.

From-SVN: r27063
1999-05-20 08:17:36 -04:00
Mark Mitchell
87533b37c7 cp-tree.h (make_ptrmem_cst): New function.
* cp-tree.h (make_ptrmem_cst): New function.
	* expr.c (cplus_expand_constant): Split out from ...
	(cplus_expand_expr): Here.  Use cplus_expand_constant.
	(init_cplus_expand): Set lang_expand_constant.
	* pt.c (convert_nontype_argument): Use make_ptrmem_cst.
	* tree.c (make_ptrmem_cst): Define.
	* typeck.c (unary_complex_lvalue): Use make_ptrmem_cst.
	* typeck2.c (initializer_constant_valid_p): Use make_ptrmem_cst.

From-SVN: r27060
1999-05-20 10:44:47 +00:00
Mark Mitchell
11f9878883 * pt.c (build_template_decl): Copy DECL_NONCONVERTING_P.
From-SVN: r27034
1999-05-19 20:01:04 +00:00
Mark Mitchell
c472cdfd0a decl2.c (start_static_storage_duration_function): Fix comment.
* decl2.c (start_static_storage_duration_function): Fix comment.
	(finish_file): Create static storage duration functions lazily.

From-SVN: r27029
1999-05-19 11:24:18 +00:00
Jason Merrill
6bdb8141ec Implement anonymous structs.
* cp-tree.h (ANON_AGGR_TYPE_P): Rename from ANON_UNION_TYPE_P.
	* class.c, decl.c, decl2.c, init.c, pt.c, search.c, typeck.c: Adjust.
	* class.c (finish_struct_1): Remove redundant check for anon struct.
	* decl.c (fixup_anonymous_aggr): Renamed from fixup_anonymous_union.
	(check_tag_decl): Check for anonymous struct here.
	* decl2.c (build_anon_union_vars): Catch anon struct at file scope.
	* init.c (sort_member_init, emit_base_init): Handle getting fields
	as well as names in current_member_init_list.
	(perform_member_init): Handle getting an anon aggr.
	* method.c (do_build_assign_ref): Don't descend into anon aggrs.
	(do_build_copy_constructor): Likewise.

From-SVN: r27027
1999-05-19 06:44:22 -04:00
Mark Mitchell
777004694d tree.c (cp_build_qualified_type): Don't allow qualified function types.
* tree.c (cp_build_qualified_type): Don't allow qualified function
	types.

From-SVN: r27021
1999-05-19 04:32:46 +00:00