Commit Graph

682 Commits

Author SHA1 Message Date
Nathan Sidwell 3cfabe60d4 class.c (modify_vtable_entry): Remove unused variable.
cp:
	* class.c (modify_vtable_entry): Remove unused variable.
	(get_vcall_index): Always expect a non-thunk.
	(update_vtable_entry_for_fn): Combine covariant adjustments, when
	overriding a thunk. Pass get_vcall_index a non-thunk.

	* decl2.c (finish_file): Mark undefined inlines as extern.
testsuite:
	* g++.dg/inherit/covariant8.C: New test.

From-SVN: r60710
2002-12-31 19:43:16 +00:00
Mark Mitchell afd9b9dd9d parse.y: Remove.
* parse.y: Remove.
	* spew.c: Likewise.
	* Make-lang.in (gt-cp-spew.h): Remove.
	* cp-tree.h (do_pending_lang_change): Remove.
	(do_identifier): Change prototype.
	(finish_id_expr): Remove.
	* decl.c (lookup_name_real): Remove yylex variable.
	* decl2.c (build_expr_from_tree): Adjust call to do_identifier.
	* lex.c (init_cpp_parse): Remove.
	(reduce_cmp): Likewise.
	(token_cmp): Likewise.
	(yychar): Likewise.
	(lastiddecl): Likewise.
	(token_count): Likewise.
	(reduce_count): Likewise.
	(yyhook): Likewise.
	(print_parse_statistics): Likewise.
	(do_pending_lang_change): Likewise.
	(do_identifier): Remove parsing parameter.
	* lex.h (lastiddecl): Remove.
	(looking_for_typename): Remove.
	(looking_for_template): Likewise.
	(pending_lang_change): Likewise.
	(yylex): Likewise.
	* semantics.c (finish_id_expr): Remove.

From-SVN: r60642
2002-12-30 19:02:11 +00:00
Nathanael Nerode 1c3139456d decl.c, [...]: GCC, not GNU CC.
* decl.c, decl2.c, decl.h:  GCC, not GNU CC.  This is the C++ front
	end, not the C front end.

From-SVN: r60636
2002-12-30 16:25:45 +00:00
Gabriel Dos Reis 848eed9249 Remove traditional C constructs 4/n.
* decl2.c (grok_method_quals, warn_if_unknown_interface,
	grok_x_components, cp_build_parm_decl, build_artificial_parm,
	maybe_retrofit_in_chrg, grokclassfn, grok_array_decl,
	delete_sanity, check_member_template, check_java_method,
	check_classfn, finish_static_data_member_decl, grokfield,
	grokbitfield, grokoptypename, grok_function_init,
	cplus_decl_attributes, constructor_name, defer_fn,
	build_anon_union_vars, finish_anon_union, coerce_new_type,
	coerce_delete_type, comdat_linkage, maybe_make_one_only,
	key_method, import_export_vtable, import_export_class,
	output_vtable_inherit, import_export_decl, import_export_tinfo,
	build_cleanup, get_guard, get_guard_bits, get_guard_cond,
	set_guard, start_objects, finish_objects,
	start_static_storage_duration_function,
	finish_static_storage_duration_function, get_priority_info,
	start_static_initialization_or_destruction,
	finish_static_initialization_or_destruction,
	do_static_initialization, do_static_destruction,
	prune_vars_needing_no_initialization, write_out_vars,
	reparse_decl_as_expr, finish_decl_parsing, namespace_ancestor,
	add_using_namespace, merge_functions, ambiguous_decl,
	lookup_using_namespace, lookup_using_namespace,
	qualified_lookup_using_namespace, set_decl_namespace,
	decl_namespace, current_decl_namespace, push_decl_namespace,
	pop_decl_namespace, push_scope, pop_scope, add_function,
	arg_assoc_namespace, arg_assoc_template_arg, arg_assoc,
	lookup_arg_dependent, do_namespace_alias,
	validate_nonmember_using_decl, do_nonmember_using_decl,
	do_toplevel_using_decl, do_local_using_decl,
	do_class_using_decl, do_using_directive, check_default_args,
	mark_used, handle_class_head): Use C90 prototypings.  Use booleans.
	* parser.c (cp_parser_class_head): Use booleanss.
	* decl.c (walk_globals, walk_vtables): Likewise.
	* cp-tree.h (walk_globals_pred, walk_globals_fn, walk_vtables,
	walk_globals): Change return type from 'int' to 'bool'.
	* rtti.c (init_rtti_processing, build_headof, throw_bad_cast
	throw_bad_typeid, get_tinfo_decl_dynamic, typeid_ok_p,
	build_typeid, tinfo_name, get_tinfo_decl, get_tinfo_ptr,
	get_typeid, ifnonnull, build_dynamic_cast_1, build_dynamic_cast,
	qualifier_flags, tinfo_base_init, generic_initializer,
	ptr_initializer, dfs_class_hint_mark, ptm_initializer,
	dfs_class_hint_unmark, class_hint_flags, class_initializer,
	typeinfo_in_lib_p, get_pseudo_ti_init, create_pseudo_type_info,
	get_pseudo_ti_desc, create_tinfo_types, emit_support_tinfos,
	unemitted_tinfo_decl_p, emit_tinfo_decl): Likewise.
	* repo.c (repo_compile_flags, repo_template_declared,
	repo_template_defined, repo_class_defined, repo_get_id,
	repo_template_used, repo_vtable_used, repo_inline_used,
	repo_tinfo_used, repo_template_instantiated, extract_string,
	open_repo_file, afgets, init_repo, reopen_repo_file_for_write,
	finish_repo): Likewise.
	* ptree.c (cxx_print_decl, cxx_print_type, cxx_print_identifier,
	cxx_print_xnode): Likewise..
	* cp-lang.c (ok_to_generate_alias_set_for_type, cxx_get_alias_set,
	cxx_warn_unused_global_decl, cp_expr_size): Likewise.
	* cxxfilt.c (demangle_it, print_demangler_list, usage,
	standard_symbol_characters, hp_symbol_characters, main, fatal):
	Likewise.
	(strip_underscore):  Change type from 'int' to 'bool'.
	(main): Use boolean constants.

From-SVN: r60601
2002-12-29 14:53:05 +00:00
Gabriel Dos Reis b746c5dc67 Remove traditional C constructs 3/n.
* cvt.c (cp_convert_to_pointer, convert_to_pointer_force,
	build_up_reference, warn_ref_binding, convert_to_reference,
	convert_from_reference, convert_lvalue, cp_convert, ocp_convert,
	convert_to_void, convert, convert_force, build_type_conversion,
	build_expr_type_conversion, type_promotes_to,
	perform_qualification_conversions): Use C90 prototyping style.
	* decl2.c (grok_array_decl): Use boolean constant.
	(delete_sanity): Likewise.
	* typeck.c (build_unary_op): Likewise.
	* semantics.c (finish_switch_cond): Likewise.
	* parser.c (cp_parser_direct_new_declarator): Likewise.
	* init.c (build_new): Likewise.

From-SVN: r60574
2002-12-28 14:38:38 +00:00
Mark Mitchell a723baf1eb Make-lang.in (po-generated): Remove parse.c.
* Make-lang.in (po-generated): Remove parse.c.
	(CXX_OBJS): Remove parse.o and spew.o.  Add parser.o.
	($(srcdir)/cp/parse.h): Remove target.
	($(srcdir)/cp/parse.c): Likewise.
	(gt-cp-parse.h): Likewise.
	(gt-cp-parser.h): New target.
	(c++.distclean): Do not remove parse.output.
	(c++.maintainer-clean): Do not remove parse.c or parse.h.
	(cp/spew.o): Remove target.
	(cp/lex.o): Adjust dependencies.
	(cp/pt.o): Likewise.
	(cp/parse.o): Likewise.
	(cp/TAGS): Do not mention parse.c.
	(cp/parser.o): New target.
	* NEWS: Mention the new parser.
	* call.c (build_scoped_method_call): Simplify.
	(build_method_call): Likewise.
	(build_new_function_call): Adjust calls to add_function_candidate
	and add_template_candidate.
	(build_new_op): Improve handling of erroroneous operands.
	(convert_default_arg): Remove circular argument processing.
	(name_as_c_string): New function.
	(build_new_method_call): Use it.
	(perform_implicit_conversion): Use error_operand_p.
	* class.c (finish_struct_anon): Use constructor_name_p.
	(check_field_decls): Likewise.
	(pop_nested_class): Use OVL_NEXT, not OVL_CHAIN.
	(resolve_address_of_overloaded_function): Likewise.
	(instantiate_type): Tweak pointer-to-member handling.
	(get_primary_binfo): Remove incorrect assertion.
	* config-lang.in (gtfiles): Add parser.c, remove parse.c.
	* cp-tree.h (DEFARG_TOKENS): New macro.
	(default_arg): New structure.
	(cp_tree_node_structure_enum): Add TS_CP_DEFAULT_ARG.
	(lang_tree_node): Add default_arg.
	(cp_tree_index): Add CPTI_TYPE_INFO_REF_TYPE.
	(type_info_ref_type): New macro.
	(saved_scope): Make processing_explicit_instantiation a boolean.
	(check_access): New field.
	(unparsed_text): Remove.
	(language_function): Remove unparsed_inlines.
	(error_operand_p): New macro.
	(lang_decl): Adjust pending_inline_info.
	(DEFARG_POINTER): Remove.
	(tag_types): Add typenames.
	(lookup_ualified_name): Declare.
	(lookup_name_real): Likewise.
	(shadow_tag): Adjust prototype.
	(get_scope_of_declarator): Declare it.
	(process_next_inline): Remove it.
	(check_for_missing_semicolon): Likewise.
	(maybe_get_template_decl_from_type_decl): Declare it.
	(finish_label_stmt): Adjust prototype.
	(finish_non_static_data_meber): Declare it.
	(finish_pseudo_destructor_call_expr): Rename to ...
	(finish_pseudo_destructor_expr): ... this.
	(finish_compound_literal): Declare it.
	(begin_inline_definitions): Remove it.
	(init_spew): Remove.
	(peekyylex): Likewise.
	(arbitrate_lookup): Likewise.
	(frob_opname): Likewise.
	(maybe_snarf_defarg): Likewise.
	(add_defarg_fn): Likewise.
	(do_pending_defargs): Likewise.
	(done_pending_defargs): Likewise.
	(unprocessed_defarg_fn): Likewise.
	(replace_defarg): Likewise.
	(end_input): Likewise.
	(get_overloaded_fn): Likewise.
	* cvt.c (convert_to_reference): Improve error handling.
	* decl.c (lookup_name_real): Do not declare it static.
	(maybe_push_to_top_level): Set check_access.
	(identifier_type_value): Adjust call to lookup_name_real.
	(lookup_qualified_name): New method.
	(lookup_name_real): Remove special-case parsing code.
	(lookup_name-nonclass): Adjust call to lookup_name_real.
	(lookup_name_namespace_only): Likewise.
	(lookup_name): Likewise.
	(check_tag_decl): Return the type declared.
	(shadow_tag): Likewise.
	(register_dtor_fn): Tweak check_access.
	(grokfndecl): Use constructor_name_p.
	(get_scope_of_declarator): New function.
	(grokdeclarator): Obscure tweaks for slightly different declarator
	representations.
	(start_method): Return error_mark_node to indicate failure.
	(cp_tree_node_structure_enum): Use TS_CP_DEFAULT_ARG for DEFAULT_ARGs.
	* decl2.c (constructor_name_full): Simplify.
	(constructor_name): Use it.
	(build_expr_from_tree): Adjust for changes to do new parser.
	(push_scope): Improve robustness.
	(validate_nonmember_using_decl): Process declarations, not names.
	(do_class_using_decl): Likewise.
	(handle_class_head): Do not mess with CLASSTYPE_DECLARED_CLASS
	here.
	* error.c (dump_expr): Handle IDENTIFIER_NODEs and BASELINKs.
	* expr.c (cxx_expand_expr): Handle BASELINKs.
	* init.c (member_init_ok_or_else): Issue more errors.
	(build_offset_ref): Tweak handling of FUNCTION_DECLs.
	* lex.c: Do not include parse.h.
	(yypring): Do not declare.
	(yylval): Likewise.
	(make_reference_declarator): Remove error-generating code.
	(rid_to_yy): Remove.
	(cxx_init): Do not call init_spew.
	(yypring): Remove.
	(check_for_missing_semicolon): Remove.
	* lex.h (got_scope): Remove.
	(got_object): Remove.
	* method.c (hack_identifier): Use finish_non_static_data_member.
	(implicitly_declare_fn): Adjust use of constructor_name.
	* parser.c: New file.
	* pt.c (parse.h): Do not include it.
	(maybe_get_template_decl_from_template): Do not declare it.
	(finish_member_template_decl): Tweak.
	(begin_explicit_instantiation): Adjust for
	processing_explicit_instantiation being boolean.
	(end_explicit_instantiation): Likewise.
	(maybe_process_partial_specialization): Tighten specialization
	test.
	(retrieve_local_specialization): Adjust ue of hash table.
	(eq_local_specializations): New function.
	(register_local_specialization): Likewise.
	(push_template_decl_real): Remove unnecessary test.
	(maybe_get_template_decl_from_type_decl): Don't make it static.
	(for_each_template_parm_r): Handle TYPEOF_TYPE.
	(tsubst_copy): Use retrieive_local_specialization to handle
	PARM_DECL.  Adjust handling of CONST_DECLs.  Handle BASELINKs.
	Handle COMPONENT_REFs with pseudo-destructor-expressions.
	Simplify handling of CALL_EXPR and METHOD_CALL_EXPR.
	(tsubst_expr): Pass decls, not names, to do_local_using_decl.
	(unify): Tweak handling of CONST_DECLs.
	(regenerate_decl_from_template): Use push_nested_class.
	(template_for_substitution): New funciton.
	(instantiate_decl): Use it.  Register parameters as local
	specializations.
	* rtti.c (init_rtti_processing): Set type_info_ref_type.
	(build_typeid): Use it.
	(get_typeid): Likeise.
	* search.c (accessible_p): Use check_access, not
	flag_access_control.
	(adjust_result_of_qualified_name_lookup): Pay attention to the
	context_class.
	* semantics.c (finish_asm_stmt): Adjust error handling.
	(finish_label_stmt): Return the statement.
	(finish_non_static_data_member): New function.
	(finish_class_expr): Handle BASELINKs.
	(finish_call_expr): Handle PSEUDO_DTOR_EXPR.
	(finish_object_call_expr): Simplify handling during templates.
	(finish_pseudo_destructor_call_expr): Rename to ...
	(finish_pseudo_dtor_expr): ... this.
	(finish_compound_literal): New function.
	(begin_inline_definitions): Remove.
	(finish_sizeof): Remove special template handling.
	* spew.c: Do not include parse.h.
	* tree.c (get_overloaded_fn): Remove.
	* typeck.c (build_class_member_access_expr): Handle
	PSEUDO_DTOR_EXPR.  Adjust handling of static member functions.
	(lookup_destructor): New function.
	(finish_class_member_access_expr): Use it.
	(convert_arguments): Simplify.
	(build_unary_op): Handle BASELINKs.

From-SVN: r60560
2002-12-28 08:03:42 +00:00
Nathan Sidwell eab5474f6d re PR c++/4803 (Inline function never defined)
cp:
	PR c++/4803
	* decl2.c (mark_used): Defer inline functions.
	(finish_file): Merge deferred_fns loops. Check all used
	inline functions have a definition.
	* method.c (make_thunk): Thunks are not inline.
testsuite:
	* g++.dg/warn/inline1.C: New test.
	* g++.old-deja/g++.brendan/crash64.C: Remove spurious inlines.
	* g++.old-deja/g++.jason/synth10.C: Likewise.
	* g++.old-deja/g++.mike/net31.C: Likewise.
	* g++.old-deja/g++.mike/p8786.C: Likewise.

From-SVN: r60521
2002-12-26 18:20:14 +00:00
Nathan Sidwell 3e14cd301c re PR c++/7964 (ICE in build_base_path)
cp:
	PR C++/7964
	* cp-tree.h (resolve_scoped_fn_name): Prototype.
	* call.c (resolve_scoped_fn_name): New function. Deal with
	more template expansion. Broken out of ...
	* parse.y (parse_finish_call_expr): ... here. Call it.
	* decl2.c (build_expr_from_tree, CALL_EXPR): Use
	resolve_scoped_fn_name and build_call_from_tree.
testsuite:
	* g++.dg/lookup/scoped3.C: New test.

From-SVN: r60483
2002-12-24 22:20:14 +00:00
Nathan Sidwell b9201622ae re PR c++/9053 (g++ confused about ambiguity of overloaded function templates)
cp:
        PR c++/9053
        * decl.c (duplicate_decls): Templates may be disambiguated by
        return type.

        PR c++/8702
        * decl2.c (check_classfn): Use lookup_fnfield_1. List all
        conversion operators on failure.
testsuite
        * g++.dg/lookup/decl1.C: New test.
        * g++.dg/lookup/decl2.C: New test.

From-SVN: r60482
2002-12-24 22:12:17 +00:00
Nathan Sidwell 081cebb27a re PR c++/8572 (ICE with external definition of conversion operator to internal class within template class)
cp:
	PR c++/8572
	* cp-tree.h (grokoptypename): Add SCOPE parameter.
	* decl2.c (grokoptypename): Add SCOPE parameter. tsubst the type
	if in a template scope.
	* parse.y (unoperator): Return the scope.
	(operator_name): Adjust grokoptypename call.
testsuite:
	* g++.dg/parse/conv_op1.C: New test.

From-SVN: r60416
2002-12-22 21:32:28 +00:00
Jason Merrill 0ca7178c84 Handle anonymous unions at the tree level.
C++ ABI change: Mangle anonymous unions using the name of their
        first named field (by depth-first search).  Should not cause
        binary compatibility problems, though, as the compiler previously
        didn't emit anything for affected unions.
        * cp-tree.def (ALIAS_DECL): New tree code.
        * decl2.c (build_anon_union_vars): Build ALIAS_DECLs.  Return the
        first field, not the largest.
        (finish_anon_union): Don't mess with RTL.  Do set DECL_ASSEMBLER_NAME,
        push the decl, and write it out at namespace scope.
        * decl.c (lookup_name_real): See through an ALIAS_DECL.
        (pushdecl): Add namespace bindings for ALIAS_DECLs.
        * rtti.c (unemitted_tinfo_decl_p): Don't try to look at the name
        of a decl which doesn't have one.
        * typeck.c (build_class_member_access_expr): Don't recurse if
        we already have the type we want.

From-SVN: r60314
2002-12-19 12:16:26 -05:00
Zack Weinberg 4977bab6ed Merge basic-improvements-branch to trunk
From-SVN: r60174
2002-12-16 18:23:00 +00:00
Mark Mitchell dcba9b0fab re PR c++/8153 (ICE with static const member in class)
PR c++/8153
	PR c++/8036
	* NEWS: Document removal of in-class initialization extension for
	static data members of non-arithmetic, non-enumeration type.
	* decl.c (check_static_variable_definition): Do not allow that
	extension.
	* decl2.c (grokfield): Do not call digest_init when processing
	templates.

	PR c++/8153
	PR c++/8036
	* g++.dg/template/static1.C: New test.
	* g++.dg/template/static2.C: New test.
	* g++.old-deja/g++.ext/memconst.C: New test.

From-SVN: r59980
2002-12-10 07:11:46 +00:00
Mark Mitchell c9f8536c5d re PR c++/8332 (strlen/template interaction causes ICE)
PR c++/8332
	PR c++/8493
	* decl.c (cxx_init_decl_processing): Use size_type_node, not
	c_size_type_node.
	* decl2.c (coerce_new_type): Likewise.
	* except.c (do_allocate_exception): Likewise.

	* builtin-types.def (BT_SIZE): Use size_type_node.
	* builtins.c (fold_builtin): Make the builtin strlen returns a
	size_t, not a sizetype.
	* c-common.c (c_sizeof_or_alignof_type): Use size_type_node, not
	c_size_type_node.
	(c_alignof_expr): Likewise.
	(c_common_nodes_and_builtins): Likewise.
	* c-common.h (CTI_C_SIZE_TYPE): Remove.
	(c_size_type_node): Likewise.
	* c-format.c (T_ST): Use size_type_node, not c_size_type_node.
	* tree.h (TI_SIZE_TYPE): New enumeral.
	(size_type_node): Likewise.

	PR c++/8332
	PR c++/8493
	* g++.dg/template/strlen1.C: New test.

From-SVN: r59689
2002-12-01 17:51:51 +00:00
Kazu Hirata 90024bdce0 ChangeLog: Follow spelling conventions.
* ChangeLog: Follow spelling conventions.
	* class.c: Likewise.
	* decl2.c: Likewise.

From-SVN: r59117
2002-11-15 05:46:34 +00:00
Geoffrey Keating 0a288b9a25 * decl2.c (finish_file): Correct spelling.
From-SVN: r58847
2002-11-06 00:44:49 +00:00
Mark Mitchell 548502d3b1 call.c (build_special_member_call): Do not try to lookup VTTs by name.
* call.c (build_special_member_call): Do not try to lookup VTTs by
	name.
	* class.c (vtbl_init_data): Add generate_vcall_entries.
	(get_vtable_decl): Do not look up virtual tables by name.
	(copy_virtuals): Do not use BV_USE_VCALL_INDEX_P.
	(set_primary_base): Do not set CLASSTYPE_RTTI.
	(determine_primary_base): Likewise.
	(get_matching_virtual): Remove.
	(get_vcall_index): New function.
	(update_vtable_entry_for_fn): Do not try to use virtual thunks
	when they are not required.  Assign vcall indices at this point.
	(finish_struct_1): Do not set CLASSTYPE_NEEDS_VIRTUAL_REINIT.
	Do update dynamic_classes.
	(build_vtt): Do not add VTTs to the symbol table.
	(build_ctor_vtbl_group): Likewise.
	(build_vtbl_initializer): Simplify handling of vcall indices.
	(build_vcall_offset_vtbl_entries): Pretend to build vcall offsets
	for the most derived class.
	(add_vcall_offset_vtbl_entries_1): But do not actually add them to
	the vtable.
	* cp-tree.h (dynamic_classes): New macro.
	(lang_type_class): Remove rtti.  Add vtables.  Add vcall_indices.
	(CLASSTYPE_RTTI): Remove.
	(CLASSTYPE_NEEDS_VIRTUAL_REINIT): Remove.
	(CLASSTYPE_VCALL_INDICES): New macro.
	(CLASSTYPE_VTABLES): Likewise.
	(BV_USE_VCALL_INDEX_P): Remove.
	(build_vtable_path): Remove.
	* decl2.c (finish_vtable_vardecl): Remove.
	(key_method): Remove #if 0'd code.
	(finish_vtable_vardecl): Rename to ...
	(maybe_emit_vtables): ... this.
	(finish_file): Use it.
	* search.c (look_for_overrides_here): Update comment.

	* g++.dg/abi/thunk1.C: New test.
	* g++.dg/abi/thunk2.C: Likewise.
	* g++.dg/abi/vtt1.C: Likewise.

From-SVN: r58779
2002-11-04 01:45:58 +00:00
Zack Weinberg 04d57dd504 PR c/7353 redux
PR c/7353 redux
cp:
	* decl2.c (grokfield): Reject TYPE_DECLs with initializers.
testsuite:
	* g++.dg/ext/typedef-init.C, gcc.dg/typedef-init.C:
	Add some more cases.

From-SVN: r58737
2002-11-02 02:17:41 +00:00
Mark Mitchell 14b4829dfd cp-tree.h (lang_decl_flags): Remove init_priority.
* cp-tree.h (lang_decl_flags): Remove init_priority.
	(lang_decl): Add delta.
	(GLOBAL_INIT_PRIORITY): Remove.
	(THUNK_DELTA): Revise definition.
	* decl2.c (start_objects): Don't set GLOBAL_INIT_PRIORITY.
	* dump.c (cp_dump_tree): Don't dump it.

From-SVN: r58680
2002-10-31 16:07:32 +00:00
Mark Mitchell 8e3df2def7 NEWS: Document removal of "new X = ..." extension.
* NEWS: Document removal of "new X = ..." extension.
	* class.c (initialize_array): Set TREE_HAS_CONSTRUCTOR on
	brace-enclosed initializers.
	* cp-tree.h (CP_AGGREGATE_TYPE_P): New macro.
	(initialize_local_var): Remove declaration.
	(expand_static_init): Likewise.
	* decl.c (next_initializable_field): New function.
	(reshape_init): Likewise.
	(check_initializer): Use them.  Build dynamic initializer for
	aggregates here too.
	(initialize_local_var): Simplify, and incorporate cleanup
	insertion code as well.
	(destroy_local_var): Remove.
	(cp_finish_decl): Tidy.
	(expand_static_init): Fold checks for whether or not a variable
	needs initialization into this function.  Simplify.
	* decl2.c (do_static_initialization): Simplify.
	* init.c (build_init): Do not set TREE_SIDE_EFFECTS when it will
	be done for us automatically.
	(expand_default_init): Handle brace-enclosed initializers
	correctly.
	(expand_aggr_init_1): Remove RTL-generation code.
	(build_vec_init): Remove "new X = ..." support.
	* parse.y (new_initializer): Likewise.
	* rtti.c (get_pseudo_ti_init): Set TREE_HAS_CONSTRUCTOR on
	brace-enclosed initializer.
	(create_pseudo_type_info): Likewise.
	* typeck2.c (store_init_value): Don't try to handle digest_init
	being called more than once.
	(digest_init): Tidy handling of brace-enclosed initializers.

	* g++.dg/init/array1.C: Remove invalid braces.
	* g++.dg/init/brace1.C: New test.
	* g++.dg/init/copy2.C: Likewise.
	* g++.dg/init/copy3.C: Likewise.
	* g++.old-deja/g++.ext/arrnew.C: Change WARNING to ERROR.
	* g++.old-deja/g++.mike/p9129.C: Add ERROR on invalid use of
	braces.

From-SVN: r58053
2002-10-11 16:50:44 +00:00
Kaveh R. Ghazi 10a38dba68 * decl2.c (prune_vtable_vardecl): Delete unused function.
From-SVN: r57994
2002-10-09 21:08:42 +00:00
Mark Mitchell edebf865cf re PR c++/7754 (ICE SIGSEGV on union with template parameter)
PR c++/7754
	* decl2.c (finish_anon_union): Do not expand anonymous unions when
	procesing template functions.
	* pt.c (tsubst_decl, case VAR_DECL): Try to complete the variable
	type. Call layout_decl.
	(tsubst_expr, case DECL_STMT): Handle anonymous unions.

From-SVN: r57961
2002-10-08 22:52:14 +00:00
Richard Henderson 01f4137fea * decl2.c, pt.c: Revert c++/7754 fix.
From-SVN: r57895
2002-10-07 02:49:18 -07:00
Mark Mitchell bd9bb3d2b0 re PR c++/7931 (The compiler ices on some legal code)
PR c++/7931
	* pt.c (for_each_template_parm_r): Handle BASELINKs.

	PR c++/7754
	* decl2.c (finish_anon_union): Do not expand anonymous unions when
	procesing template functions.
	* pt.c (tsubst_decl, case VAR_DECL): Try to complete the variable
	type. Call layout_decl.
	(tsubst_expr, case DECL_STMT): Handle anonymous unions.

	PR c++/7931
	* g++.dg/template/ptrmem3.C: New test.

	PR c++/7754
	* g++.dg/template/union1.C: New test.

From-SVN: r57800
2002-10-04 05:13:59 +00:00
Kazu Hirata 838dfd8a4e ChangeLog: Follow spelling conventions.
* ChangeLog: Follow spelling conventions.
	* ChangeLog.2: Likewise.
	* call.c: Likewise.
	* class.c: Likewise.
	* cp-tree.h: Likewise.
	* cvt.c: Likewise.
	* decl.c: Likewise.
	* decl2.c: Likewise.
	* except.c: Likewise.
	* friend.c: Likewise.
	* g++spec.c: Likewise.
	* init.c: Likewise.
	* lex.c: Likewise.
	* mangle.c: Likewise.
	* method.c: Likewise.
	* operators.def: Likewise.
	* optimize.c: Likewise.
	* pt.c: Likewise.
	* rtti.c: Likewise.
	* search.c: Likewise.
	* semantics.c: Likewise.
	* spew.c: Likewise.
	* tree.c: Likewise.
	* typeck.c: Likewise.

From-SVN: r57387
2002-09-21 12:51:56 +00:00
Devang Patel 70b76b34a3 cp-tree.h: New prototype for walk_vtabls().
2002-09-19  Devang Patel  <dpatel@apple.com>
       * cp/cp-tree.h: New prototype for walk_vtabls().
       * cp/decl.c (walk_vtables_r): New function.
       (struct cp_binding_level): Add new members, namespaces,
       names_size and vtables.
       (add_decl_to_level): Add decl in namespaces or vtables
       chain, if conditions match.
       (walk_vtables): New function.
       (walk_namespaces_r): Travers separate namespace chain
       for namespace decls.
       (wrapup_globals_for_namespace): Use names_size instead
       of list_length().
       * cp/decl2.c (finish_file): Use walk_vtables() instead of
       walk_globals() to walk vtable decls.

From-SVN: r57305
2002-09-19 09:19:36 -07:00
Kazu Hirata a1c65f9f4f decl.c: Fix comment formatting.
* decl.c: Fix comment formatting.
	* decl2.c: Likewise.

From-SVN: r57104
2002-09-13 11:33:47 +00:00
Alexandre Oliva c01b9ec8eb parse.y (sizeof, [...]): New non-terminals to increment skip_evaluation.
* parse.y (sizeof, alignof, typeof): New non-terminals to
increment skip_evaluation.  Replace terminals with them and
decrement skip_evaluation at the end of rules using them.
* decl2.c (mark_used): Don't assemble_external if
skipping evaluation.

From-SVN: r56359
2002-08-15 21:16:52 +00:00
Kaveh R. Ghazi e65e6212f7 decl2.c (build_call_from_tree): Fix uninitialized variable.
* decl2.c (build_call_from_tree): Fix uninitialized variable.
	* parse.y (parse_finish_call_expr): Likewise.
	* repo.c (old_args, old_dir, old_main): Const-ify.

From-SVN: r56208
2002-08-11 18:30:25 +00:00
Mike Stump 0e3397527a call.c (add_builtin_candidate): legal -> valid, illegal -> invalid.
* call.c (add_builtin_candidate): legal -> valid, illegal -> invalid.
        (type_decays_to): Likewise.
        * class.c (find_final_overrider): Likewise.
        (maybe_note_name_used_in_class): Likewise.
        * decl.c (current_tmpl_spec_kind): Likewise.
        (add_binding): Likewise.
        (push_class_binding): Likewise.
        (duplicate_decls): Likewise.
        (layout_var_decl): Likewise.
        (grokfndecl): Likewise.
        (grokdeclarator): Likewise.
        (check_default_argument): Likewise.
        * decl2.c (handle_class_head): Likewise.
        * error.c (dump_template_decl): Likewise.
        * init.c (build_offset_ref): Likewise.
        * pt.c (check_specialization_scope): Likewise.
        (determine_specialization): Likewise.
        (check_explicit_specialization): Likewise.
        (maybe_check_template_type): Likewise.
        (process_partial_specialization): Likewise.
        (check_default_tmpl_args): Likewise.
        (push_template_decl_real): Likewise.
        (convert_template_argument): Likewise.
        (try_class_unification): Likewise.
        (get_bindings_real): Likewise.
        (do_decl_instantiation): Likewise.
        * semantics.c (begin_function_definition): Likewise.
        (finish_member_declaration): Likewise.
        (check_multiple_declarators): Likewise.
        * typeck.c (comp_array_types): Likewise.
        (comptypes): Likewise.
        (expr_sizeof): Likewise.
        (build_binary_op): Likewise.
        (dubious_conversion_warnings): Likewise.
        (check_return_expr): Likewise.

From-SVN: r56144
2002-08-09 01:16:39 +00:00
Mark Mitchell 50ad964280 Rework build_component_ref.
* call.c (build_vfield_ref): Do not go through build_component_ref.
	(build_field_call): Use build_class_member_access_expr.
	(build_user_type_conversion_1): Use BASELINK_FUNCTIONS.
	(build_object_call): Likewise.
	* class.c (convert_to_base): New function.
	(type_requires_array_cookie): Use BASELINK_FUNCTIONS.
	(instantiate_type): Handle BASELINKs.
	* cp-tree.def (BASELINK): New tree code.
	* cp-tree.h (BASELINK_P): Reimplement.
	(SET_BASELINK_P): Remove.
	(BASELINK_BINFO): Reimplement.
	(BASELINK_FUNCTIONS): Likewise.
	(BASELINK_ACCESS_BINFO): Likewise.
	(BASELINK_OPTYPE): Likewise.
	(convert_to_base): New function.
	(name_p): Likewise.
	(build_object_ref): Remove.
	(build_component_ref_1): Likewise.
	(build_component_ref): Likewise.
	(build_x_component_ref): Likewise.
	(build_class_member_access_expr): New function.
	(finish_class_member_access_expr): Likewise.
	(build_ptrmemfunc_access_expr): Likewise.
	* decl.c (grokdeclarator): Handle BASELINKs.
	* decl2. (build_expr_from_tree): Handle COMPONENT_REFs by using
	finish_class_member_access_expr.
	(arg_assoc): Handle BASELINKs.
	(do_class_using_decl): Likewise.
	* error.c (dump_decl): Likewise.
	(dump_expr): Use build_ptrmemfunc_access_expr.
	* except.c (dtor_nothrow): Use CLASSTYPE_DESTRUCTORS to find
	destructors.
	(build_throw): Use BASELINK_FUNCTIONS.
	* init.c (perform_member_init): Use
	build_class_member_access_expr.
	(build_offset_ref): Handle BASELINKs.  Use
	build_class_member_access_expr.
	* method.c (hack_identifier): Likewise.
	* parse.y (do_id): Use BASELINK, not TREE_LIST.
	(primary): Remove uses of build_object_ref.
	* pt.c (lookup_template_function): Handle BASELINKs.
	(resolve_overloaded_unification): Likewise.
	* search.c (build_baselink): Build a BASELINK, not a TREE_LIST.
	(lookup_field): Use BASELINK, not TREE_LIST.
	(lookup_fnfiels): Likewise.
	(setup_class_bindings): Likewise.
	* semantics.c (finish_object_call_expr): Do not use
	build_method_call when we already know what function is being
	called.
	* spew.c (identifier_type): Use BASELINK, not TREE_LIST.
	* tree.c (really_overloaded_fn): Use OVL_CHAIN for OVERLOADs, not
	TREE_CHAIN.
	(name_p): New function.
	* typeck.c (build_object_ref): Remove.
	(build_component_ref_1): Likewise.
	(build_x_component_ref): Likewise.
	(build_class_member_access_expr): New function.
	(finish_class_member_access_expr): Likewise.
	(build_ptrmemfunc_access_expr): Likewise.
	(get_member_function_from_ptrfunc): Use
	build_ptrmemfunc_access_expr.
	(build_binary_op): Likewise.
	(build_unary_op): Likewise.
	(build_ptrmemfunc): Likewise.
	(pfn_from_ptrmemfunc): Likewise.
	* typeck2.c (build_m_component_ref): Adjust comment.

	* g++.dg/abi/offsetof.C: Tweak error messages.
	* g++.old-deja/g++.mike/p10769a.C: Likewise.

From-SVN: r56117
2002-08-08 05:48:39 +00:00
Neil Booth 0b6f2917cf Makefile.in (c-opts.o, [...]): Update.
* Makefile.in (c-opts.o, c-common.o, C_AND_OBJC_OBJS): Update.
	* c-common.c: Don't include tree-inline.h.
	(c_common_init_options, c_common_post_options): Move to c-opts.c.
	* c-common.h (c_common_decode_option): New.
	* c-decl.c (c_decode_option): Remove.
	* c-lang.c (LANG_HOOKS_DECODE_OPTION): Use c_common_decode_option.
	* c-opts.c: New file.
	* c-tree.h (c_decode_option): Remove.
	* doc/passes.texi: Update.
	* objc/objc-act.c (objc_decode_option): Remove.
	* objc/objc-act.h (objc_decode_option): Remove.
	* objc/ojbc-lang.c (LANG_HOOKS_DECODE_OPTION): Use
	c_common_decode_option.
cp:
	* Make-lang.in (CXX_C_OBJS): Update.
	* cp-lang.c (LANG_HOOKS_DECODE_OPTION): Use c_common_decode_option.
	* cp-tree.h (cxx_decode_option): Remove.
	* decl2.c (compare_options, lang_f_options, unsupported_options,
	cxx_decode_option): Remove.
testsuite:
	* objc.dg/const-str-2.m: Update.
	* gcc.dg/cpp/c++98.c: Change to C extension.
	* gcc.dg/cpp/c++98-pedantic.c: Similarly.
	* gcc.dg/cpp/cpp.exp: Process .C extensions too.

From-SVN: r56105
2002-08-07 18:32:13 +00:00
Geoffrey Keating b3426eb9e2 Index: ChangeLog
2002-08-05  Geoffrey Keating  <geoffk@redhat.com>

	* attribs.c: Don't include obstack.h.
	* builtins.c: Likewise.
	* cfganal.c: Likewise.
	* cfgbuild.c: Likewise.
	* cfgcleanup.c: Likewise.
	* emit-rtl.c: Likewise.
	* loop.c: Likewise.
	* stmt.c: Likewise.

Index: cp/ChangeLog
2002-08-05  Geoffrey Keating  <geoffk@redhat.com>

	* class.c: Don't include obstack.h.
	(popclass):
	* decl2.c: Delete bogus comment.
	* error.c: Don't include obstack.h.
	* except.c: Likewise.
	(dump_type): Correct comment.
	* method.c: Don't include obstack.h.
	* tree.c: Likewise.

Index: java/ChangeLog
2002-08-05  Geoffrey Keating  <geoffk@redhat.com>

	* mangle_name.c: Don't include obstack.h twice.
	* xref.c: Don't include obstack.h.

From-SVN: r56055
2002-08-05 18:46:37 +00:00
Neil Booth 4078b403a7 c-common.c: Define all C/ObjC/C++ warning and flag variables.
* c-common.c: Define all C/ObjC/C++ warning and flag variables.
	* c-common.h: Declare all C/ObjC/C++ warning and flag variables.
	* c-decl.c: Move all warning and flag variables to c-common.c.
	* c-format.c: Move all warning variables to c-common.c.
	* c-tree.h: Move all warning and flag declarations to c-common.h.
	* objc/objc-act.c: Move all warning variables to c-common.c.
	(flag_warn_protocol): Rename warn_protocol.
cp:
	* cp-tree.h: Move all warning and flag declarations to c-common.h.
	* decl.c: Move all warning and flag variables to c-common.c.
	* decl2.c: Move all warning and flag variables to c-common.c.
	* lex.c (flag_digraphs): Remove.
	(warn_traditional): Now in c-common.c.

From-SVN: r55923
2002-08-01 06:20:46 +00:00
Mark Mitchell 4ba126e468 call.c (build_field_call): Do not look up the field by name.
* call.c (build_field_call): Do not look up the field by name.
	(build_method_call): Simplify.
	(struct z_candidate): Add access_path and conversion_path.  Remove
	basetype_path.
	(convert_class_to_reference): Adjust use of
	add_function_candidate.
	(add_candidate): Add conversion_path argument.
	(add_function_candidate): Use it.
	(add_conv_dndidate): Likewise.
	(build_builtin_candidate): Likewise.
	(add_template_candidate_real): Add conversion_path argument.
	(add_template_conv_candidate): Likewise.
	(add_template_candidate): Likewise.
	(build_user_type_conversion_1): Use it.
	(build_new_function_call): Remove name lookup code.  Adjust use of
	add_template_candidate and add_function_candidate.
	(build_new_op): Likewise.
	(convert_like_real): Use build_special_member_call.
	(build_over_call): Use cand->conversion_path.
	(build_special_member_call): New method.
	(build_new_method_call): Remove name lookup code.
	* cp-tree.def (OFFSET_REF): Update documentation.
	(TEMPLATE_ID_EXPR): Likewise.
	* cp-tree.h (BASELINK_ACCESS_BINFO): New macro.
	(BASELINK_OPTYPE): Likewise.
	(build_new_method_call): Adjust prototype.
	(build_special_member_call): New method.
	(build_baselink): New method.
	(build_offset_ref_call_from_tree): Likewise.
	(build_call_from_tree): Likewise.
	(finish_qualified_call_expr): Remove.
	(finish_call_expr): Adjust prototype.
	(build_x_function_call): Remove.
	* cvt.c (ocp_convert): Use build_special_member_call.
	* decl2.c (reparse_absdcl_as_expr): Use finish_call_expr.
	(build_expr_from_tree): Adjust handling for TEMPLATE_ID_EXPR and
	CALL_EXPR.
	(build_offset_ref_call_from_tree): New function.
	(build_call_from_tree): Likewise.
	* init.c (expand_cleanup): Use build_special_member_call.
	(expand_default_init): Likewise.
	(build_member_call): Use finish_call_expr.
	(build_new_1): Use build_special_member_call.
	(push_base_cleanups): Likewise.
	* method.c (do_build_assign_ref): Likewise.
	* parse.y (template_id): Do not pass a COMPONENT_REF to
	lookup_template_function.
	(primary): Use parse_finish_call_epxr, not finish_call_expr.
	(parse_finish_call_expr): New function.
	* pt.c (lookup_template_function): Add assertions.
	* search.c (lookup_base): Allow T to be a binfo.
	(build_baselink): New function.
	(lookup_member): Use it.
	* semantics.c (finish_call_expr): Do not do name lookup.
	(finish_object_call_expr): Remove #if 0'd code.
	(finish_qualified_call_expr): Remove.
	* typeck.c (build_x_function_call): Remove.
	(build_static_case): Use build_special_member_call.
	* typeck2.c (build_functional_cast): Likewise.

	* g++.dg/inherit/operator1.C: New test.
	* g++.dg/lookup/disamb1.C: Fix typo in comment.
	* g++.dg/other/error1.C: Change expected error message.
	* g++.dg/template/conv4.C: Likewise.

From-SVN: r55920
2002-08-01 04:46:23 +00:00
Roger Sayle a3926fe192 decl2.c (cxx_decode_option): Support -fno-builtin-foo.
* cp/decl2.c (cxx_decode_option): Support -fno-builtin-foo.

	* doc/invoke.texi: Document that both -fno-builtin-foo and
	-fno-builtin are supported by the g++ front-end.

From-SVN: r55802
2002-07-27 21:15:39 +00:00
Jason Merrill 8e51619a4c function.c (assign_parms): Handle frontend-directed pass by invisible reference.
* function.c (assign_parms): Handle frontend-directed pass by
        invisible reference.
cp/
        * call.c (build_over_call): Likewise.
        (cp_convert_parm_for_inlining): New fn.
        (convert_for_arg_passing): New fn.
        (convert_default_arg, build_over_call): Use it.
        (type_passed_as): New fn.
        * pt.c (tsubst_decl): Use it.
        * decl2.c (cp_build_parm_decl): New fn.
        (build_artificial_parm): Use it.
        (start_static_storage_duration_function): Likewise.
        * decl.c (start_cleanup_fn, grokdeclarater): Likewise.
        (grokparms): Don't mess with DECL_ARG_TYPE.
        * typeck.c (convert_arguments): Use convert_for_arg_passing.
        * cp-lang.c (LANG_HOOKS_TREE_INLINING_CONVERT_PARM_FOR_INLINING):
        Define.
        * cp-tree.h: Declare new fns.

From-SVN: r55781
2002-07-26 16:10:43 -04:00
Neil Booth c372b0fa93 c-common.h (RID_AND, [...]): Remove.
* c-common.h (RID_AND, RID_AND_EQ, RID_NOT, RID_NOT_EQ,
	RID_OR, RID_OR_EQ, RID_XOR, RID_XOR_EQ, RID_BITAND, RID_BITOR,
	RID_COMPL): Remove.
	* c-parse.in (rid_to_yy): Similarly.
cp:
	* cp-tree.h (flag_operator_names): Remove.
	* decl2.c (flag_operator_names): Remove.
	(lang_f_options): Remove operator-names.
	* lex.c (D_OPNAME): Remove.
	(reswords): Remove operator names.
	(rid_to_yy): Remove operator names.
	(init_reswords): No need to handle D_OPNAME.
	* spew.c (read_process_identifier): There are no operator
	names.

From-SVN: r55777
2002-07-26 16:23:07 +00:00
Gabriel Dos Reis ea79391291 c-common.c (c_sizeof_or_alignof_type): Take a third argument for complaining.
* c-common.c (c_sizeof_or_alignof_type): Take a third argument for
	complaining.
	* c-common.h (c_sizeof): Adjust definition.
	(c_alignof): Likewise.
	* c-tree.h (c_sizeof_nowarn): Now macro.
	* c-typeck.c (c_sizeof_nowarn): Remove definition.
cp/
	* cp-tree.h (cxx_sizeof_nowarn): Now a macro.
	(cxx_sizeof_or_alignof_type): Take a third argument.
	(cxx_sizeof): Adjust definition.
	(cxx_alignof): Likewise.
	* init.c (build_delete): Use cxx_sizeof_nowarn to reflect reality.
	* typeck.c (cxx_sizeof_or_alignof_type): Take a third argument for
	complaining.
	(c_sizeof_nowarn): Remove definition.
	(build_unary_op): Use cxx_sizeof_nowarn.

From-SVN: r55744
2002-07-25 08:58:07 +00:00
Neil Booth 2d6154445d c-decl.c (c_decode_option): No need to handle switches cpplib handles.
* c-decl.c (c_decode_option): No need to handle switches
	cpplib handles.
cp:
	* decl2.c (cxx_decode_option): Similarly.

From-SVN: r55737
2002-07-25 06:56:11 +00:00
Gabriel Dos Reis fa72b06489 Fix PR/7363:
2002-07-21  Gabriel Dos Reis  <gdr@nerim.net>

        Fix PR/7363:
        * c-common.c (c_sizeof_or_alignof_type): New function.
        (c_alignof): Remove definition.
        * c-common.h (c_sizeof, c_alignof): Define as macros.
        (c_sizeof_or_alignof_type): Declare.
        (my_friendly_assert): Moved from cp/cp-tree.h
        * c-typeck.c (c_sizeof): Remove definition.

cp/

2002-07-21  Gabriel Dos Reis  <gdr@nerim.net>

        Fix PR/7363:
        * typeck.c (cxx_sizeof_or_alignof_type): New function.
        (c_sizeof): Remove definition.
        (expr_sizeof): Use cxx_sizeof.
        * decl2.c (build_expr_from_tree): Use cxx_sizeof_or_alignof_type.
        * decl.c (finish_destructor_body): Use cxx_sizeof.
        * semantics.c (finish_alignof): Likewise.
        (finish_alignof): Use cxx_alignof.
        * cp-tree.h (cxx_sizeof, cxx_alignof): New macros.
        (cxx_sizeof_or_alignof_type): Declare.
        (my_friendly_assert): Move to ../c-common.h.

From-SVN: r55678
2002-07-23 13:54:06 +00:00
Roger Sayle b886c620ab decl2.c (cxx_decode_option): Simplify -fhandle-exceptions test by using positive_option.
* decl2.c (cxx_decode_option): Simplify -fhandle-exceptions
	test by using positive_option.  Make whitespace consistent.

From-SVN: r55616
2002-07-21 02:07:01 +00:00
Mark Mitchell 8ba658eea5 cp-tree.h (constructor_name_p): Declare it.
* cp-tree.h (constructor_name_p): Declare it.
	(check_template_template_default_arg): Likewise.
	* class.c (handle_using_decl): Use constructor_name_p.
	* decl.c (grokdeclarator): Likewise.
	* decl2.c (constructor_name_p): Define it.
	* init.c (build_member_call): Use constructor_name_p.
	* parse.y (template_parm): Use check_template_template_default_arg.
	* pt.c (check_explicit_specialization): Use constructor_name_p.
	* semantics.c (check_template_template_default_arg): New function.

From-SVN: r55350
2002-07-09 23:31:28 +00:00
Nathan Sidwell c6f553d129 Repair damage on weak-impared targets caused by my previous patch.
* cp-tree.h (import_export_tinfo): Add parameter.
	* decl2.c (import_export_tinfo): Add parameter, post adjust
	DECL_COMDAT.
	* rtti.c (emit_tinfo_decl): DECL_COMDAT is (nearly) always setup by
	import_export_tinfo.

From-SVN: r55257
2002-07-05 10:40:47 +00:00
Nathan Sidwell d689a8f192 cp-tree.h (CPTI_TINFO_DECL_TYPE): Replace with ...
* cp-tree.h (CPTI_TINFO_DECL_TYPE): Replace with ...
	(CPTI_TYPE_INFO_PTR_TYPE): ... this.
	(tinfo_decl_type): Replace with ...
	(type_info_ptr_type): ... this.
	(import_export_tinfo): Declare.
	(tinfo_decl_p): Rename to ...
	(unemitted_tinfo_decl_p): ... this.
	* decl2.c (import_export_decl): Break out tinfo handling into ...
	(import_export_tinfo): ... here. New function.
	(finish_file): Adjust.
	* rtti.c (TINFO_REAL_NAME): New macro.
	(init_rtti_processing): Create the tinfo types.
	(get_tinfo_decl_dynamic): Use type_info_ptr_type, get_tinfo_ptr.
	(get_tinfo_decl): Adjust.
	(get_tinfo_ptr): New function.
	(get_type_id): Use it.
	(tinfo_base_init): Create vtable decl here, if it doesn't exist.
	(ptr_initializer): Use get_tinfo_ptr.
	(ptm_initializer): Likewise.
	(synthesize_tinfo_var): Break into ...
	(get_pseudo_ti_init): ... this. Just create the initializer.
	(get_pseudo_ti_desc): .. and this.
	(create_real_tinfo_var): Remove.
	(create_pseudo_type_info): Don't create the vtable decl here.
	(get_vmi_pseudo_type_info): Remove.
	(create_tinfo_types): Adjust.
	(tinfo_decl_p): Rename to ...
	(unemitted_tinfo_decl_p): ... here. Adjust.
	(emit_tinfo_decl): Adjust. Create the initializer.

From-SVN: r55124
2002-06-30 20:41:38 +00:00
Mark Mitchell 88e5899c42 cp-tree.h (xref_tag): Change prototype.
* cp-tree.h (xref_tag): Change prototype.
	(handle_class_head): Likewise.
	(build_x_component_ref): Likewise.
	* decl.c (cxx_init_decl_processing): Adjust call to xref_tag.
	(xref_tag): Take attributes as a separate parameter.
	(xref_tag_from_type): Adjust call to xref_tag.
	* decl2.c (build_expr_from_tree): Adjust call to
	build_x_component_ref.
	(handle_class_head): Take attributes as a separate parameter.
	* parse.y (parse_xref_tag): New function.
	(parse_handle_class_head): Likewise.
	(primary): Use parse_xref_tag.
	(class_head_decl): Use parse_handle_class_head.
	(class_head_defn): Likewise.
	* rtti.c (init_rtti_processing): Adjust call to xref_tag.
	(build_dynamic_cast_1): Likewise.
	(create_pseudo_type_info): Likewise.
	(emit_support_tinfos): Likewise.
	* typeck.c (build_object_ref): Adjust call to
	build_x_component_ref.
	(build_x_component_ref): Remove protect parameter.

From-SVN: r55013
2002-06-26 17:03:44 +00:00
Mark Mitchell 80b1331c3e parse.y (parse_scoped_id): New function.
* parse.y (parse_scoped_id): New function.
	(primary): Use it.
	* cp-tree.h (do_scoped_id): Adjust declaration.
	* lex.c (do_scoped_id): Remove call to yylex.
	* decl2.c (build_expr_from_tree): Adjust use of do_scoped_id.
	* typeck2.c (add_exception_specifier): Use tree_cons, rather than
	expanding it inline.

From-SVN: r54930
2002-06-23 20:10:09 +00:00
Richard Henderson 750491fc10 c-common.c (flag_ms_extensions): Move from c++ front end.
* c-common.c (flag_ms_extensions): Move from c++ front end.
        * c-common.h (flag_ms_extensions): Declare.
        * c-decl.c (c_decode_option): Add -fms-extensions.
        (grokfield): Don't accept anonymous structures in ISO C mode;
        accept only unnamed anonymous structures in GNU C mode; accept
        Plan 9 extensions in MS mode.
        * c-parse.in (SAVE_EXT_FLAGS, RESTORE_EXT_FLAGS): Rename from
        SAVE/RESTORE_WARN_FLAGS; add flag_iso frobbing; update all callers.
        (extension): Clear flag_iso.
        * doc/invoke.texi (C Dialect Options): Add -fms-extensions.

        * cp-tree.h, decl2.c (flag_ms_extensions): Move to c-common.

        * g++.dg/ext/anon-struct1.C: New.
        * g++.dg/ext/anon-struct2.C: New.
        * g++.dg/ext/anon-struct3.C: New.
        * gcc.dg/anon-struct-1.c: New.
        * gcc.dg/anon-struct-2.c: New.
        * gcc.dg/anon-struct-3.c: New.
        * gcc.dg/20011008-1.c: Adjust warning text.
        * gcc.dg/20020527-1.c: Add -fms-extensions.

From-SVN: r54670
2002-06-16 12:09:30 -07:00
Zack Weinberg 09e77dee59 cppinit.c (COMMAND_LINE_OPTIONS): Give all relevant -W options their own entries.
* cppinit.c (COMMAND_LINE_OPTIONS): Give all relevant -W
	options their own entries.
	(parse_option): Clarify comment.
	(cpp_handle_option): Remove 'ignore' parameter and OPT_W
	special case.  Replace if/strcmp chain for -W options with
	use of new OPT_* entries for them.
	(cpp_handle_options): Update to match.
	* cpplib.h: Remove last parameter to cpp_handle_option from prototype.
	* c-decl.c, cp/decl2.c: Update call to cpp_handle_option.

From-SVN: r54352
2002-06-07 22:24:30 +00:00
H.J. Lu 4bafaa6fdc configure.in: Add --enable-__cxa_atexit.
2002-06-07  H.J. Lu  (hjl@gnu.org)

	* configure.in: Add --enable-__cxa_atexit.
	* configure: Regenerated.
	* config.in: Likewise.

	* defaults.h (DEFAULT_USE_CXA_ATEXIT): New. Defined to be 0 if
	not defined.

2002-06-07  H.J. Lu  (hjl@gnu.org)

	* decl2.c (flag_use_cxa_atexit): Set to DEFAULT_USE_CXA_ATEXIT.

From-SVN: r54345
2002-06-07 10:14:56 -07:00