Commit Graph

297 Commits

Author SHA1 Message Date
Mark Mitchell b74a056019 cp-tree.h (popclass): Change declaration.
* cp-tree.h (popclass): Change declaration.
	(pop_nested_class): Likewise.
	(poplevel_class): Remove declaration.
	* call.c (convert_default_argument): Pass no arguments to
	popclass.
	* class.c (finish_struct_1): Likewise.
	(finish_struct): Likewise.
	(popclass): Remove argument.  Simplify code accordingly.
	(pop_nested_class): Likewise.
	* decl.c (poplevel_class): Declare it here, and make it static.
	(poplevel): Handle class scopes.
	(pop_level_class): Don't take an rgument.  Simplify.
	(pop_everything): Pass no arguments to pop_nested_class.
	(cp_finish_decl): Pass no arguments to popclass.
	(grokdeclarator): Pass no arguments to pop_nested_class.
	(finish_function): Likewise.
	* decl2.c (grokfield): Likewise.
	(pop_scope): Pass no arguments to popclass.
	* lex.c (do_pending_defargs): Pass no arguments to pop_nested_class.
	* pt.c (instantiate_class_template): Move call to pushclass, and
	document.  Pass no arguments to popclass.
	(regenerate_decl_from_template): Likewise.

From-SVN: r26454
1999-04-14 13:20:19 +00:00
Martin v. Löwis 2de45c0679 extend.texi (Deprecated Features): New node.
* extend.texi (Deprecated Features): New node.
	* invoke.texi (-Wdeprecated): Document.
	* cp/lang-options.h (-Wdeprecated): New flag.
	* cp/decl2.c (warn_deprecated): New flag.
	(lang_decode_option): Deprecated this-is-variable,
	external-templates, alt-external-templates.
	Support -Wdeprecated.
	* cp/errfn.c (cp_deprecated): New function.

From-SVN: r26438
1999-04-14 05:34:55 +00:00
Jason Merrill 187e786433 decl2.c (setup_initp): Compare DECL_ASSEMBLER_NAME instead of the decls themselves.
* decl2.c (setup_initp): Compare DECL_ASSEMBLER_NAME instead
	of the decls themselves.

From-SVN: r26435
1999-04-13 20:00:20 -04:00
Mike Stump 9c73ec8469 decl2.c (import_export_decl): Because vtables always reference virtual functions...
* decl2.c (import_export_decl): Because vtables always reference
	virtual functions, even if they are inlined, don't allow
	-fno-implement-inlines to not emit them, instead, emit them with
	the vtable.
	* decl.c (start_function): Likewise.
Fixes vtable1.C

From-SVN: r26416
1999-04-13 18:09:57 +00:00
Jason Merrill aff08c1864 cp-tree.h (struct lang_type): Add com_interface.
* cp-tree.h (struct lang_type): Add com_interface.
	(CLASSTYPE_COM_INTERFACE): New macro.
	* class.c (set_rtti_entry): COM interface classes have no RTTI
	entries in their vtables; adjust.
	(add_virtual_function, finish_base_struct, skip_rtti_stuff,
	modify_one_vtable, fixup_vtable_deltas1, override_one_vtable,
	finish_struct_1): Likewise.
	* decl2.c (mark_vtable_entries): Likewise.
	* rtti.c (build_headof, get_tinfo_fn_dynamic): Likewise.
	* search.c (get_abstract_virtuals_1, get_abstract_virtuals,
	expand_upcast_fixups): Likewise.
	* tree.c (debug_binfo): Likewise.

From-SVN: r26394
1999-04-12 20:39:32 -04:00
Mark Mitchell 8f0327178b tinfo.h (__class_type_info): Fix illegal declaration.
1999-04-02  Mark Mitchell  <mark@codesourcery.com>
	* tinfo.h (__class_type_info): Fix illegal declaration.
	* cp-tree.def (TEMPLATE_ID_EXPR): Update comment.
	* cp-tree.h (INHERITED_VALUE_BINDING_P): New macro.
	(IDENTIFIER_CLASS_VALUE): Improve documentation.
	(is_properly_derived_from): Declare.
	(invalidate_class_lookup_cache): Likewise.
	(maybe_maybe_note_name_used_in_class): Likewise.
	(note_name_declared_in_class): Likewise.
	(push_using_decl): Remove duplicate declaration.
	(id_in_current_class): Remove declaration.
	(push_class_binding): Change prototype.
	(clear_identitifer_class_values): Declare.
	* call.c (is_properly_derived_from): Make it global.
	(build_new_function_call): Be careful about updating candidates.
	(build_new_method_call): Handle COMPONENT_REFs.  Don't crash when
	asked to make illegal calls.
	* class.c: Include splay-tree.h.
	(class_stack_node): Add names_used slot.
	(check_member_decl_is_same_in_complete_scope): Remove.
	(add_method): Fix comment.  Push the declaration into class
	scope.
	(finish_struct_1): When popping the class, pop the bindings too.
	Remove check for data member/function member conflict.
	(finish_struct): Remove calls to
	check_member_decl_is_same_in_complete_scope.  Change calls to
	popclass.
	(pushclass): Clear names_used in the class stack entry.
	Use invalidate_class_lookup_cache to remove cached entries, rather
	than magic values with popclass.  Clear IDENTIFIER_CLASS_VALUE
	before entering a new class.  Remove dead code.  Don't mess with
	current_function_decl when pushing declarations.
	(invalidate_class_lookup_cache): New function, split out from ...
	(popclass): Here.  Clean up names_used on our way out.
	(instantiate_type): Adjust.
	(build_self_reference): Don't push the declaration here.
	(maybe_note_name_used_in_class): New function.
	(note_name_declared_in_class): Likewise.
	* decl.c (add_binding): Change prototype.
	(find_class_binding_level): New function.
	(innermost_nonclass_level): Likewise.
	(current_binding_level): Update documentation.
	(inner_binding_level): Remove.  Replace with current_binding_level
	throughout.
	(push_binding_level): Remove special handling of
	class_binding_level.
	(pop_binding_level): Likewise.  Use find_class_binding_level.
	(suspend_binding_level): Likewise.
	(global_bindings_p): Use innermost_nonclass_level.
	(toplevel_bindings_p): Likewise.
	(namespace_bindings_p): Likewise.
	(pseudo_global_level_p): Likewise.
	(push_binding): Clear INHERITED_VALUE_BINDING_P.
	(add_binding): Check for illegal multiple declarations.  Return a
	value indicating whether or not the new binding was legal.
	(push_local_binding): Skip over class binding levels.  Check
	return value from add_binding.
	(push_class_binding): Set INHERITED_VALUE_BINDING_P.  Call
	note_name_declared_in_class.
	(pushlevel_class): Remove "fake out the rest of the compiler"
	code.
	(poplevel_class): Reset IDENTIFIER_CLASS_VALUEs.
	(clear_identifier_class_values): New function.
	(pop_from_top_level): Use it.
	(pop_everything): Tweak.
	(maybe_process_template_type_declaration): Don't push the
	declaration for the template here.
	(pushtag): Don't push tag declarations into class scope here.
	(pushdecl): Apply DeMorgan's law for readability.
	(pushdecl_class_level): Remove special-case code for
	TYPE_BEING_DEFINED.  Handle OVERLOADs and anonymous unions.
	(push_class_level_bindng): Deal with inherited bindings.
	(lookup_name_real): Remove special-case code for
	TYPE_BEING_DEFINED, and some implicit typename magic.
	(grokdeclarator): Handle COMPONENT_REF for a template function.
	(build_enumerator): Don't call pushdecl_class_level here.
	(id_in_current_class): Remove.
	* decl2.c (grokfield): Don't call pushdecl_class_level or
	check_template_shadow.
	* errfn.c (cp_file_of): Don't declare.
	(cp_line_of): Likewise.
	* error.c (dump_decl): Handle an OVERLOAD.
	(cp_file_of): Likewise.
	(cp_line_of): Likewise.
	* init.c (build_member_call): Handle a COMPONENT_REF.
	* lex.c (do_identifier): Call maybe_note_name_used_in_class, not
	pushdecl_class_level.
	* method.c (hack_identifier): Build COMPONENT_REFs for references
	to member templates as well as member functions.  Remove dead
	code.
	* parse.y (left_curly): Remove.
	(nonnested_type): Call maybe_note_name_used_in_class, not
	pushdecl_class_level.
	* parse.c: Regenerated.
	(nested_name_specifier_1): Likewise.
	* pt.c (check_explicit_specialization): Adjust, for robustness.
	(check_template_shadow): Handle OVERLOADs.
	(build_template_decl): Set DECL_CONSTRUCTOR_P on the
	TEMPLATE_DECL, if appropriate.
	* search.c (envelope_add_decl): Remove.
	(dfs_pushdecls): Likewise.
	(dfs_compress_decls): Likewise.
	(dfs_push_decls): New function.
	(dfs_push_type_decls): Likewise.
	(setup_class_bindings): Likewise.
	(template_self_reference_p): Likewise.
	(lookup_field_r): Use it.
	(looup_member): Remove old comment.  Deal with ambiguity.
	(push_class_decls): Use dfs_push_decls and dfs_push_type_decls,
	and remove envelope processing.
	* semantics.c (begin_class_definition): Let pushclass push
	declarations for base classes.
	(finish_member_declaration): Push declarations into class scope.
	* typeck.c (build_component_ref): Just put an OVERLOAD into the
	COMPONENT_REF, not a TREE_LIST of an OVERLOAD.
	(build_x_function_call): Deal with OVERLOAD.  Handle template-ids.
	* Makefile.in (class.o): Depend on splay-tree.h.

From-SVN: r26133
1999-04-02 15:36:57 +00:00
Jason Merrill 9af3a23b20 * decl2.c (lang_decode_option): Remove -Wsign-promo from -Wall.
From-SVN: r26060
1999-03-29 11:13:51 -05:00
Kaveh R. Ghazi d8e178a02b Warning fixes:
* call.c (op_error): Const-ify a char*.
        (add_candidate, source_type, add_warning): Add static prototype.
        (print_z_candidates): Const-ify a char*.
        * class.c (resolve_address_of_overloaded_function,
        fixed_type_or_null, build_vtable_entry_ref): Add static prototype.
        (get_vtable_name, finish_struct_1): Const-ify a char*.
        * cvt.c (convert_to_reference): Likewise.
        * decl.c (redeclaration_error_message, record_builtin_type,
        record_unknown_type, member_function_or_else, bad_specifiers):
        Likewise.
        (find_binding, select_decl, unqualified_namespace_lookup,
        lookup_flags, qualify_lookup, record_builtin_java_type, tag_name):
        Add static prototype.
        (warn_extern_redeclared_static, duplicate_decls, pushdecl,
        implicitly_declare, record_builtin_java_type, define_function,
        grok_op_properties, tag_name): Const-ify a char*.
        * cp-tree.h (FORMAT_VBASE_NAME): Allow parameter `BUF' to be const.
        (define_function, finish_builtin_type): Const-ify a char*.
        (cp_error, cp_error_at, cp_warning, cp_warning_at, cp_pedwarn,
        cp_pedwarn_at, cp_compiler_error, cp_sprintf): Add prototype args.
        (file_name_nondirectory): Const-ify a char*.
        (init_filename_times): Don't prototype.
        (compiler_error): Prototype.
        (yyerror, init_repo): Const-ify a char*.
        (build_srcloc): Don't prototype.
        (build_x_indirect_ref, build_indirect_ref, build_component_addr):
        Const-ify a char*.
        (warn_for_assignment): Don't prototype.
        (convert_for_initialization, readonly_error, check_for_new_type,
        GNU_xref_begin, GNU_xref_file, GNU_xref_ref, GNU_xref_call):
        Const-ify a char*.
        * decl2.c (acceptable_java_type, output_vtable_inherit,
        setup_initp, start_objects, finish_objects, do_dtors, do_ctors,
        merge_functions, decl_namespace, validate_nonmember_using_decl,
        do_nonmember_using_decl): Add static prototype.
        (lang_f_options): Const-ify a char*.
        (finish_builtin_type): Likewise.
        (add_function, arg_assoc_namespace, arg_assoc_class): Add static
        prototype.
        * errfn.c: Include cp-tree.h.
        (cp_thing): Add static prototype.
        (compiler_error): Don't protoptype.
        (cp_compiler_error): Cast `compiler_error' to `errorfn' before
        passing it to `cp_thing'.
        * error.c (interesting_scope_p): Add static prototype.
        * except.c (build_eh_type_type, build_eh_type_type_ref): Const-ify
        a char*.
        * init.c (compiler_error): Don't prototype.
        (member_init_ok_or_else): Const-ify a char*.
        (build_java_class_ref): Add static prototype.
        * lex.c (compiler_error): Don't prototype.
        (get_time_identifier, interface_strcmp, extend_token_buffer,
        handle_cp_pragma): Const-ify a char*.
        (is_global, init_filename_times): Add static prototype.
        (file_name_nondirectory, cplus_tree_code_name): Const-ify a char*.
        (compiler_error): Change from fixed args to variable args.
        (yyerror): Const-ify a char*.
        * parse.y (cond_stmt_keyword): Const-ify a char*.
        (parse_decl): Add static prototype.
        * pt.c (template_args_equal, print_template_context): Likewise.
        (print_candidates, check_default_tmpl_args): Const-ify a char*.
        (instantiate_class_template): Likewise.
        * repo.c (get_base_filename, open_repo_file, init_repo): Likewise.
        * rtti.c (call_void_fn, expand_generic_desc, expand_si_desc,
        expand_class_desc, expand_ptr_desc, expand_attr_desc): Likewise.
        * search.c (lookup_field_info, lookup_member): Likewise.
        (lookup_member): Cast the first argument of `bzero' to a PTR.
        * sig.c (compiler_error): Don't prototype.
        (build_signature_pointer_or_reference_nam): Const-ify a char*.
        (get_sigtable_name, build_member_function_pointer): Likewise.
        * tree.c (compiler_error): Don't prototype.
        (no_linkage_helper, build_srcloc): Add static prototype.
        (build_vbase_pointer_fields): Const-ify a char*.
        (__eprintf): Don't unnecessarily handle `const' when !__STDC__.
        * typeck.c (compiler_error): Don't prototype.
        (convert_for_assignment): Const-ify a char*.
        (comp_cv_target_types): Add static prototype.
        (build_x_indirect_ref, build_indirect_ref, convert_arguments,
        build_component_addr, build_unary_op, convert_for_initialization):
        Const-ify a char*.
        * typeck2.c (ack): Add static prototype and change from fixed args
        to variable args.
        (readonly_error, check_for_new_type): Const-ify a char*.
        * xref.c (_XREF_FILE, find_file, filename, fctname, declname,
        fixname, open_xref_file, classname, GNU_xref_begin): Likewise.
        (GNU_xref_file): Likewise.  Also use `xmalloc' instead of `malloc'.
        (GNU_xref_end_scope, GNU_xref_ref, GNU_xref_decl, GNU_xref_call,
        gen_assign, GNU_xref_member): Const-ify a char*.

From-SVN: r25994
1999-03-26 07:45:00 +00:00
Jason Merrill 2f435bed98 * decl2.c (comdat_linkage): Treat vtables like functions.
From-SVN: r25985
1999-03-25 14:45:25 -05:00
Jason Merrill ea735e02ae decl2.c (finish_file): Set at_eof to 2 after expanding ctors.
* decl2.c (finish_file): Set at_eof to 2 after expanding ctors.
	* decl.c (expand_static_init): Make sure we don't add any after
	then.
	* decl.c (cp_finish_decl): Move intelligence about handling
	DECL_COMDAT for variables from here...
	* decl2.c (comdat_linkage): ...to here.
	(maybe_make_one_only): Tweak.
	(import_export_decl): Call comdat_linkage for variables, too.
	(finish_file): Handle template statics properly.

From-SVN: r25920
1999-03-22 21:33:34 -05:00
Mark Mitchell b5d51daa7e decl2.c (validate_nonmember_using_decl): Issue sensible error-messages on bogus qualifiers.
* decl2.c (validate_nonmember_using_decl): Issue sensible
	error-messages on bogus qualifiers.

From-SVN: r25781
1999-03-15 13:08:26 +00:00
Martin v. Löwis c592d5d258 decl.c (select_decl): Allow class templates when we need types.
* decl.c (select_decl): Allow class templates when we need types.
        * decl2.c (ambiguous_decl): Likewise.

From-SVN: r25737
1999-03-12 23:17:05 +00:00
Jason Merrill 3c2a009706 decl2.c (setup_initp): Give statics with no priority the default priority here.
* decl2.c (setup_initp): Give statics with no priority the default
	priority here.
	(do_dtors, do_ctors, finish_file): Remove special handling of
	non-prioritized statics.

From-SVN: r25613
1999-03-05 22:54:30 -05:00
Jason Merrill e9659ab02f class.c, [...]: Add 'static' to make SunOS 4 cc happy.
* class.c, decl2.c, method.c, pt.c: Add 'static' to make SunOS 4
	cc happy.
	* decl2.c (import_export_class): Also return if
	CLASSTYPE_INTERFACE_ONLY is set.

From-SVN: r25562
1999-03-03 06:24:45 -05:00
Martin v. Löwis 0580c9aa4c decl.c (push_overloaded_decl): Only overwrite the old binding if there was one.
* decl.c (push_overloaded_decl): Only overwrite the old binding if
	there was one.
	* decl2.c (do_local_using_decl): Fix loop termination.

From-SVN: r25560
1999-03-03 11:22:42 +00:00
Nathan Sidwell 6654316990 typeck.c (complete_type_or_else): Add VALUE arg, for helpful diagnostics.
* typeck.c (complete_type_or_else): Add VALUE arg, for helpful
	diagnostics.
	cp-tree.h (complete_type_or_else): Added VALUE parameter.
	* init.c (build_new_1): Extra arg to complete_type_or_else.
	(build_delete): Likewise.
	* typeck.c (require_complete_type): Likewise.
	(pointer_int_sum): Likewise.
	(pointer_diff): Likewise.
	(build_component_ref): Likewise.
	* typeck2.c (incomplete_type_error): Always use cp_error.
	Show declaration of undefined type, if appropriate.
	Deal with UNKNOWN_TYPE nodes.
	* typeck.c (require_complete_type): Use TYPE_SIZE as
	size_zero_node to mean incomplete type.
	(require_complete_type_in_void): New function.
	(build_compound_expr): Call complete_type_in_void for LHS.
	(build_c_cast): Call complete_type_in_void for void cast.
	* cvt.c (ocp_convert): Call complete_type_in_void for void cast.
	* decl.c (cplus_expand_expr_stmt): Void expression checks moved to
	require_complete_type_in_void. Call it.
	* cp-tree.h (require_complete_type_in_void): Prototype new function.
	* typeck.c (convert_arguments): Use alternative format for function
	decls. Don't require_complete_type here. Simplify diagnostic printing.
	(convert_for_initialization): Don't require_complete_type on RHS yet.
	* call.c (convert_arg_to_ellipsis): Call require_complete_type.
	* call.c (build_over_call): Cope with qualified void return type.
	* semantics.c (finish_call_expr): Likewise
	* typeck.c (build_function_call_real): Likewise
	(c_expand_return): Likewise
	* decl2.c (reparse_absdcl_as_expr): Cope with qualified void type.
	* call.c (print_z_candidates): Use alternate print format, to be
	consistant with (pt.c) print_candidates.
	method.c (hack_identifier): List candidate members.
	search.c (lookup_field): Build ambiguous list, and show it, if
	ambiguous.

From-SVN: r25474
1999-02-26 18:37:04 -05:00
Jason Merrill b262d64c12 typeck.c (convert_for_assignment): Allow boolean integral constant expressions to convert to null pointer.
* typeck.c (convert_for_assignment): Allow boolean integral constant
	expressions to convert to null pointer.
	* decl.c (lookup_namespace_name): Resolve namespace aliases.
	* class.c (push_nested_class): Allow namespaces.
	* decl2.c (set_decl_namespace): Add friendp parameter.
	* decl.c (grokfndecl): Pass it.
	(grokvardecl): Likewise.
	* cp-tree.h: Change declaration.

From-SVN: r25420
1999-02-24 19:11:35 -05:00
Jeffrey A Law 14686fcda5 tm.texi: Update docs for constructors and destructors.
* tm.texi: Update docs for constructors and destructors.
And update comment in cp/decl2.c

From-SVN: r25356
1999-02-21 12:58:22 -07:00
H.J. Lu b4bb92e52f decl2.c (start_objects): Make file scope constructors and destructors local to the file if...
* decl2.c (start_objects): Make file scope constructors and
        destructors local to the file if ASM_OUTPUT_CONSTRUCTOR and
        ASM_OUTPUT_DESTRUCTOR are defined.

From-SVN: r25354
1999-02-21 12:42:18 -07:00
Mark Mitchell 0301787454 cp-tree.h (CLASSTYPE_METHOD_VEC): Adjust comment.
1999-02-19  Mark Mitchell  <mark@markmitchell.com>
	* cp-tree.h (CLASSTYPE_METHOD_VEC): Adjust comment.
	(fn_type_unification): Adjust prototype.
	(lookup_fnfields_1): Declare.
	* call.c (add_template_candidate_real): Adjust call to
	fn_type_unification.
	* class.c (add_method): Don't allow duplicate declarations of
	constructors or destructors.
	(resolve_address_of_overloaded_function): Remove unused variable.
	Adjust call to fn_type_unification.
	* decl.c (grokfndecl): Be more robust in the face of illegal
	specializations.
	* decl2.c (check_classfn): Remove hokey handling of member
	templates.
	* pt.c (determine_specialization): Improve comments.  Adjust to
	handle template argument deduction as per the standard.
	(check_explicit_specialization): Fix comment spacing.  Handle
	type-conversion operators correctly.  Improve error-recovery.
	(fn_type_unification): Remove EXTRA_FN_ARG parameter.
	(get_bindings_real): Simplify handling of static members.
	* search.c (lookup_fnfields_1): Make it have external linkage.
	* typeck.c (compparms): Fix comment.
	(build_unary_op): Don't try to figure out which template
	specialization is being referred to when when the address-of
	operator is used with a template function.

From-SVN: r25347
1999-02-21 16:38:23 +00:00
Jason Merrill 0c20d3d607 decl.c (pushdecl): Remove dead code.
* decl.c (pushdecl): Remove dead code.
	* decl2.c (finish_objects): Fix code I missed in previous change.

From-SVN: r25242
1999-02-16 06:15:16 -05:00
Jason Merrill efe38fabae decl.c (grokdeclarator): Catch wierd declarators.
* decl.c (grokdeclarator): Catch wierd declarators.
	* decl2.c (finish_file): Don't abort because of namespace parsing
	failure.
	(check_decl_namespace): Remove.

From-SVN: r25144
1999-02-10 19:00:28 -05:00
Jason Merrill 700466c28c pt.c (maybe_process_partial_specialization): Complain about specialization in wrong namespace.
* pt.c (maybe_process_partial_specialization): Complain about
	specialization in wrong namespace.
	* tree.c (decl_namespace_context): New fn.
g++.pt/explicit73.C
	* decl2.c (arg_assoc_type): Handle TEMPLATE_TEMPLATE_PARM.
	* pt.c (coerce_template_template_parms): Handle nested
	template template parameters.
g++.pt/nttp[12].C

From-SVN: r25072
1999-02-07 10:44:12 -05:00
Jason Merrill 000ab922b0 decl2.c: Remove flag_init_priority.
* decl2.c: Remove flag_init_priority.  Always enable initp stuff.
	(start_objects, finish_objects): Only use special
	init_priority code if the user specified a priority.
	(do_ctors, do_dtors): Use DEFAULT_INIT_PRIORITY for the non-initp
	objects.

From-SVN: r25037
1999-02-04 21:47:00 -05:00
Theodore Papadopoulo 0daa67d1d6 * decl2.c (lang_decode_option): Use read_integral_parameter.
From-SVN: r24986
1999-02-02 14:47:20 -07:00
Zack Weinberg be163a70f5 flags.h: Declare flag_no_ident.
1999-01-31 17:52 -0500  Zack Weinberg  <zack@midnite.ec.rhno.columbia.edu>
	* flags.h: Declare flag_no_ident.
	* toplev.c: Define flag_no_ident.  Process -f(no-)ident here.
	* c-decl.c: Don't define flag_no_ident.  Don't process
          -f(no-)ident switches here.
	* ch/decl.c: Likewise.
	* cp/decl2.c: Likewise.
	* c-tree.h: Don't declare flag_no_ident.
	* ch/ch-tree.h: Likewise.
	* cp/cp-tree.h: Likewise.
	* config/elfos.h (ASM_FILE_END): Output final .ident directive
          only if !flag_no_ident.
	* config/ptx4.h: Likewise.
	* config/svr4.h: Likewise.
	* config/alpha/elf.h: Likewise.
	* config/arm/linux-elf.h: Likewise.
	* config/i386/sco5.h: Likewise.
	* config/i860/fx2800.h: Likewise.
	* config/mips/gnu.h: Likewise.
	* config/i386/osfrose.h: Likewise.
	* gcc.c (C specs): Map -Qn to -fno-ident.
	* ch/lang-specs.h: Likewise.
	* cp/lang-specs.h: Likewise.
	* f/lang-specs.h: Likewise.
	* objc/lang-specs.h: Likewise.
	* java/lang-specs.h: Likewise.

From-SVN: r24943
1999-01-31 17:46:42 +00:00
Jason Merrill 0034cf7299 tree.c (equal_functions): Fix name in prototype.
* tree.c (equal_functions): Fix name in prototype.
	* decl.c (push_local_binding): Add FLAGS argument.
	(pushdecl, push_overloaded_decl): Pass it.
	* decl2.c (do_local_using_decl): Likewise.
	* cp-tree.h: Adjust prototype.
	* decl.c (poplevel): Fix logic.

From-SVN: r24869
1999-01-25 21:33:46 -05:00
Jason Merrill 1f90179302 decl.c (start_function): Make member functions one_only on windows.
* decl.c (start_function): Make member functions one_only on windows.
	* decl2.c (import_export_decl): Likewise.
	* decl.c (grokdeclarator): Don't complain about implicit int in
	a system header.  Change same-name field check to not complain in
	a system header instead of within extern "C".

From-SVN: r24839
1999-01-23 19:59:21 -05:00
Mark Mitchell 7bdbfa05db cp-tree.h (PUSH_GLOBAL): New macro.
* cp-tree.h (PUSH_GLOBAL): New macro.
	(PUSH_LOCAL): Likewise.
	(PUSH_USING): Likewise.
	(namespace_bindings_p): Declare.
	(push_overloaded_decl): Likewise.
	* decl.c (push_overloaded_decl): Don't make it static.  Check for
	illegal declarations after using declarations here.
	(namespace_bindings_p): Likewise.
	(duplicate_decls): Don't consider declarations from different
	namespaces to be the same.
	(pushdecl): Use symbolic PUSH_ constants in calls to
	push_overloaded_decl.
	(push_overloaded_decl_1): Likewise.
	* decl2.c (validate_nonmember_using_decl): Tweak `std' handling.
	(do_nonmember_using_decl): Check for illegal using declarations
	after ordinary declarations here.
	(do_local_using_decl): Call pushdecl to insert declarations.

From-SVN: r24812
1999-01-21 21:16:22 +00:00
Jason Merrill e2213efb9d decl2.c (finish_vtable_vardecl): Make vtables comdat here.
* decl2.c (finish_vtable_vardecl): Make vtables comdat here.
	(import_export_vtable): Not here.

From-SVN: r24761
1999-01-19 06:14:54 -05:00
Jason Merrill ddaed37e04 typeck.c (comp_ptr_ttypes_reinterpret): Per ANSI, tighten up definition of 'casting away const' in reinterpret_cast<>.
* typeck.c (comp_ptr_ttypes_reinterpret): Per ANSI, tighten up
	definition of 'casting away const' in reinterpret_cast<>.
	* cvt.c: Add include for decl.h, remove extern for
	static_aggregates which is now provided by decl.h.
	* Makefile.in (cvt.o): Add dependency for decl.h and missing
	dependencies for convert.h and flags.h.
	* decl2.c (do_dtors): Set current location to that of the
	decl, for sensible diagnostics and debugging.
	(check_classfn): Issue `incomplete type' error, if
	class is not defined.
	* cp-tree.h: Add prototype for bound_pmf_p.

From-SVN: r24748
1999-01-18 07:49:20 -05:00
Jason Merrill ad236eab58 re PR other/18132 (Problem compiling gcc 3.4.2)
* semantics.c (finish_asm_stmt): Don't warn about redundant volatile.
PR 18132
	* decl2.c (import_export_class): MULTIPLE_SYMBOL_SPACES only means
	that we don't suppress the other copies.
	* lex.c (handle_cp_pragma): Likewise.
PR 18627

From-SVN: r24662
1999-01-14 05:42:12 -05:00
Mark Mitchell d8f8dca15f class.c (pushclass): Tweak handling of class-level bindings.
* class.c (pushclass): Tweak handling of class-level bindings.
	(resolve_address_of_overloaded_function): Update pointer-to-member
	handling.
	(instantiate_type): Likewise.
	* cvt.c (cp_convert_to_pointer): Likewise.
	* decl.c (pop_binding): Take the DECL to pop, not just the name.
	Deal with `struct stat' hack.
	(binding_level): Add to documentation.
	(push_binding): Clear BINDING_TYPE.
	(add_binding): New function.
	(push_local_binding): Use it.
	(push_class_binding): Likewise.
	(poplevel): Adjust calls to pop_binding.
	(poplevel_class): Likewise.
	(pushdecl): Adjust handling of TYPE_DECLs; add bindings for hidden
	declarations to current binding level.
	(push_class_level_binding): Likewise.
	(push_overloaded_decl): Adjust handling of OVERLOADs in local
	bindings.
	(lookup_namespace_name): Don't crash when confronted with a
	TEMPLATE_DECL.
	(lookup_name_real): Do `struct stat' hack in local binding
	contexts.
	(build_ptrmemfunc_type): Adjust documentation.
	(grokdeclarator): Don't avoid building real array types when
	processing templates unless really necessary.
	(finish_method): Adjust calls to pop_binding.
	* decl2.c (reparse_absdcl_as_expr): Recursively call ourselves,
	not reparse_decl_as_expr.
	(build_expr_from_tree): Deal with a template-id as the function to
	call in a METHOD_CALL_EXPR.
	* pt.c (convert_nontype_argument): Tweak pointer-to-member handling.
	(maybe_adjust_types_For_deduction): Don't do peculiar things with
	METHOD_TYPEs here.
	(resolve_overloaded_unification): Handle COMPONENT_REFs.  Build
	pointer-to-member types where necessary.
	* tree.c (build_cplus_array_type_1): Don't avoid building real
	array types when processing templates unless really necessary.
	(build_exception_variant): Compare the exception lists correctly.

From-SVN: r24314
1998-12-14 15:35:40 +00:00
Mark Mitchell f181d4aea0 cp-tree.def (CPLUS_BINDING): Update documentation.
* cp-tree.def (CPLUS_BINDING): Update documentation.
	* cp-tree.h (LOCAL_BINDING_P): New macro.
	(lang_identifier): Rename local_value to bindings.
	(tree_binding): Make `scope' of type `void*', not `tree'.
	(BINDING_SCOPE): Update documentation.
	(IDENTIFIER_LOCAL_VALUE): Remove.
	(IDENTIFIER_CLASS_VALUE): Document.
	(IDENTIFIER_BINDING): New macro.
	(IDENTIFIER_VALUE): Likewise.
	(TIME_IDENTIFIER_TIME): Likewise.
	(TIME_IDENTIFIER_FILEINFO): Likewise.
	(IMPLICIT_TYPENAME_P): Likewise.
	(set_identifier_local_value): Remove.
	(push_local_binding): New function.
	(push_class_binding): Likewise.
	* class.c (pushclass): Update comments; use push_class_binding.
	* decl.c (set_identifier_local_value_with_scope): Remove.
	(set_identifier_local_value): Likewise.
	(push_binding): New function.
	(pop_binding): Likewise.
	(binding_level): Update documentation.  Remove shadowed.
	(BINDING_LEVEL): New macro.
	(free_binding_nodes): New variable.
	(poplevel): Adjust for new name-lookup scheme.  Don't mess up
	BLOCK_VARs when doing for-scope extension.  Remove effectively
	dead code.
	(pushlevel_class): Tweak formatting.
	(poplevel_class): Adjust for new name-lookup scheme.
	(print_binding_level): Likewise.
	(store_bindings): Likewise.
	(pushdecl): Likewise.
	(pushdecl_class_level): Likewise.
	(push_class_level_binding): Likewise.
	(push_overloaded_decl): Update comments.  Adjust for new
	name-lookup scheme.
	(lookup_name_real): Likewise.
	(lookup_name_current_level): Likewise.
	(cp_finish_decl): Likewise.
	(require_complete_types_for_parms): Likewise.  Remove misleading
	#if 0'd code.
	(grok_parms): Likewise.  Don't call
	require_complete_types_for_parms here.
	(grok_ctor_properties): Don't treat templates as copy
	constructors.
	(grop_op_properties): Or as assignment operators.
	(start_function): Document.  Adjust for new name-lookup scheme.
	(finish_function): Likewise.
	* decl2.c (do_local_using_decl): Use push_local_binding.
	* lex.c (begin_definition_of_inclass_inline): New function, split
	out from ...
	(do_pending_inlines): Here, and ...
	(process_next_inline): Here.
	(get_time_identifier): Use TIME_IDENTIFIER_* macros.
	(init_filename_times): Likewise.
	(extract_interface_info): Likewise.
	(ste_typedecl_interface_info): Likewise.
	(check_newline): Likewise.
	(dump_time_statistics): Likewise.
	(handle_cp_pragma): Likewise.
	(do_identifier): Adjust for new name-lookup scheme.
	* parse.y (function_try_block): Return ctor_initializer_opt value.
	(fndef): Use it.
	(fn.defpen): Pass appropriate values to start_function.
	(pending_inline): Use functor_try_block value, and pass
	appropriate values to finish_function.
	* pt.c (is_member_template): Update documentation; remove handling
	of FUNCTION_DECLs.  As per name, this function should deal only in
	TEMPLATE_DECLs.
	(decl_template_parm_p): Change name of olddecl parameter to decl.
	(check_template_shadow): Adjust for new name-lookup scheme.
	(lookup_template_class): Likewise.
	(tsubst_decl): Tweak so as not to confuse member templates with
	copy constructors and assignment operators.
	(unify): Handle UNION_TYPEs.
	* ptree.c (print_lang_identifier): Adjust for new name-lookup scheme.
	(lang_print_xnode): Adjust for new name-lookup scheme.
	* typeck.c (mark_addressable): Likewise.
	(c_expand_return): Likewise.

From-SVN: r24296
1998-12-13 14:46:07 +00:00
Dave Brolley dfb0fb1d90 lex.c (lang_init_options): Initialize cpplib.
Wed Dec  9 15:33:01 1998  Dave Brolley  <brolley@cygnus.com>
	* lex.c (lang_init_options): Initialize cpplib.
	* decl2.c (parse_options,cpp_initialized): Removed.
	(lang_decode_option): Move initialization of cpplib to
	lang_init_options.

From-SVN: r24221
1998-12-09 07:51:24 -05:00
Zack Weinberg 3a5ac29d20 decl2.c: s/data/opts/ when initializing cpp_reader structure.
1998-12-07  Zack Weinberg  <zack@rabi.phys.columbia.edu>
	* cp/decl2.c: s/data/opts/ when initializing cpp_reader
          structure.

From-SVN: r24155
1998-12-07 09:20:55 -05:00
Jason Merrill 2642b9bfd5 decl.c (build_typename_type): Set DECL_ARTIFICIAL.
* decl.c (build_typename_type): Set DECL_ARTIFICIAL.
	* error.c (dump_simple_decl): Also print namespace context.
	(dump_function_decl): Likewise.
	* decl2.c (ambiguous_decl): Don't print old value if it's
	error_mark_node.
	* decl.c (lookup_name_real): Fix handling of local types shadowed
	by a non-type decl.  Remove obsolete code.
	* cp-tree.h (DECL_FUNCTION_SCOPE_P): New macro.
Fixes g++.other/lookup6.C
	* lang-options.h: Add -fpermissive.
	* decl2.c: Likewise.
	* cp-tree.h: Add flag_permissive.
	* decl.c (init_decl_processing): If neither -fpermissive or -pedantic
	were specified, set flag_pedantic_errors.
	* call.c (build_over_call): Turn dropped qualifier messages
	back into pedwarns.
	* cvt.c (convert_to_reference): Likewise.
	* typeck.c (convert_for_assignment): Likewise.

From-SVN: r24150
1998-12-07 07:27:47 -05:00
Jason Merrill e5b0708ab9 sort
From-SVN: r24124
1998-12-05 20:44:12 -05:00
Jason Merrill ee996e9e57 decl2.c (coerce_new_type): Use same_type_p.
* decl2.c (coerce_new_type): Use same_type_p.
	(coerce_delete_type): Likewise.
	* call.c (check_dtor_name): Return 1, not error_mark_node.

From-SVN: r24122
1998-12-05 20:33:10 -05:00
Jason Merrill f3400fe27c pt.c (check_template_shadow): New fn.
* pt.c (check_template_shadow): New fn.
	* decl2.c (grokfield): Use it.
	* decl.c (pushdecl): Likewise.
	(pushdecl_class_level): Likewise.
	(start_method): Likewise.
	(xref_tag): Don't try to use 't' if we're defining.
Fixes Sec14/7/C14387.cm.
	* call.c (check_dtor_name): Just return an error_mark_node.
	* pt.c (lookup_template_class): Complain about using non-template here.
	* parse.y (apparent_template_type): Not here.
Fixes Sec14/C14339.cm.
	* pt.c (check_explicit_specialization): Complain about specialization
	with C linkage.
Fixes Sec14/C14340.cm.
	* lang-options.h: Add -f{no-,}implicit-inline-templates.
	* pt.c (convert_nontype_argument): Don't assume that any integer
	argument is intended to be a constant-expression.
Fixes Sec14/7/P14245.C.

From-SVN: r24086
1998-12-04 06:14:21 -05:00
Mark Mitchell 066b4a1cc8 decl2.c (validate_nonmember_using_decl): Complain about using declarations for class members.
* decl2.c (validate_nonmember_using_decl): Complain about using
	declarations for class members.

From-SVN: r24060
1998-12-02 10:12:20 +00:00
Jason Merrill 0b5be8972f update copyrights
From-SVN: r23764
1998-11-22 22:12:41 -05:00
Jason Merrill 72a9314325 class.c (finish_struct_1): Set things up for 0-width bitfields like we do for others.
* class.c (finish_struct_1): Set things up for 0-width bitfields
	like we do for others.
	* decl.c (check_tag_decl): New fn.
	(shadow_tag): Split out from here.
	* decl2.c (grok_x_components): Call it.

From-SVN: r23762
1998-11-22 20:14:55 -05:00
Martin v. Löwis 75fbcb7dd5 decl2.c (validate_nonmember_using_decl): Allow using templates from the global namespace.
* decl2.c (validate_nonmember_using_decl): Allow using templates
	from the global namespace.

From-SVN: r23742
1998-11-21 13:42:29 +00:00
Jason Merrill 161c12b0bf Handle specifying template args to member function templates.
* tree.c (build_overload): Always create an OVERLOAD for a template.
	* search.c (add_conversions): Handle finding an OVERLOAD.
	* decl2.c (check_classfn): Likewise.
	* lex.c (identifier_type): See through a baselink.
	* parse.y (do_id): Don't call do_identifier if we got a baselink.
	* class.c (instantiate_type, case TREE_LIST): Recurse.
	* decl.c (grokdeclarator): Allow a boolean constant for array
	bounds, odd as that sounds.
	* pt.c (unify): Be more strict about non-type parms, except for
	array bounds.
	(UNIFY_ALLOW_INTEGER): New macro.

From-SVN: r23740
1998-11-21 00:42:20 -05:00
Jason Merrill ff350acdf9 semantics.c (begin_class_definition): Call maybe_process_partial_specialization before push_template_decl.
* semantics.c (begin_class_definition): Call
	maybe_process_partial_specialization before push_template_decl.
	Don't call push_template_decl for a specialization.
	* search.c (lookup_field): Do return a member template class.
	* decl2.c (handle_class_head): Handle member template classes.
	* decl.c (grokdeclarator): A parm type need not be complete.
	* pt.c (convert_nontype_argument): Fix thinko.

From-SVN: r23705
1998-11-18 21:35:15 -05:00
Jason Merrill 8ebeee52bc search.c (get_abstract_virtuals): Complain about virtuals with no final overrider.
* search.c (get_abstract_virtuals): Complain about virtuals with
	no final overrider.
	* typeck2.c (abstract_virtuals_error): Remove handling for virtuals
	with no final overrider.
	* class.c (override_one_vtable): Don't set DECL_ABSTRACT_VIRTUAL_P
	on virtuals with no final overrider.
Fixes Sec10/3/E10120.C
	* lex.c (reinit_parse_for_block): Add a space after the initial ':'.
Fixes Sec9/7/R09434.r0
	* class.c (finish_struct_1): Don't remove zero-width bit-fields until
	after layout_type.
Fixes Sec9/6/P09024.C
	* friend.c (do_friend): Don't set_mangled_name_for_decl.
Fixes Sec9/2/P09075.C
	* class.c (finish_struct_anon): Complain about non-fields.
	* decl2.c (build_anon_union_vars): Likewise.
	* decl.c (grokdeclarator): Normal data members can't have the same
	name as the class, either.
	* class.c (finish_struct_anon): Neither can members of an
	anonymous union.
Fixes Sec9/2/C09268.cm

From-SVN: r23691
1998-11-17 21:21:54 -05:00
Jason Merrill 8452b1d3c1 class.c (instantiate_type): Be more helpful.
* class.c (instantiate_type): Be more helpful.
	* decl2.c (import_export_decl): Call import_export_class.
	* cp-tree.h (EMPTY_CONSTRUCTOR_P): Check !TREE_HAS_CONSTRUCTOR.
	* decl2.c (build_expr_from_tree): Propagate TREE_HAS_CONSTRUCTOR.
	* pt.c (tsubst_copy): Likewise.

From-SVN: r23511
1998-11-03 12:37:51 -05:00
Mark Mitchell 3bfdc7190f cp-tree.h (COMPARE_STRICT): New macro.
* cp-tree.h (COMPARE_STRICT): New macro.
	(COMPARE_BASE): Likewise.
	(COMPARE_RELAXED): Likewise.
	(COMPARE_REDECLARATION): Likewise.
	(same_type_p): Likewise.
	(same_or_base_type_p): Likewise.
	* call.c (standard_conversion): Use them, in place of comptypes
	with numeric arguments.
	(reference_binding): Likewise.
	(convert_like): Likewise.
	(build_over_call): Likewise.
	(is_subseq): Likewise.
	(is_properly_derived_from): Likewise.
	(compare_ics): Likewise.
	(joust): Likewise.
	* class.c (delete_duplicate_fields_1): Likewise.
	(resolves_to_fixed_type_p): Likewise.
	(instantiate_type): Likewise.  Remove #if 0'd code.
	* decl.c (decls_match): Likewise.  Use COMPARE_REDECLARATION here.
	(pushdecl): Likewise.
	(lookup_name_real): Likewise.
	(grokdeclarator): Likewise.  Check for illegal array declarations.
	(grokparms): Likewise.
	(grok_op_properties): Likewise.
	* decl2.c (check_classfn): Likewise.
	* friend.c (is_friend): Likewise.
	(make_friend_class): Likewise.
	* init.c (expand_aggr_init): Likewise.
	(expand_vec_init): Likewise.
	* pt.c (is_member_template_class): Remove declaration.
	(is_specialization_of): Use COMPARE_* and new macros.
	(comp_template_parms): Likewise.
	(convert_nontype_argument): Likewise.
	(coerce_template_template_parms): Likewise.
	(template_args_equal): Likewise.
	(lookup_template_class): Likewise.
	(type_unification_real): Likewise.
	(unify): Likewise.
	(get_bindings_real): Likewise.
	* search.c (covariant_return_p): Likewise.
	(get_matching_virtual): Likewise.
	* sig.c (match_method_types): Likewise.
	* tree.c (vec_binfo_member): Likewise.
	(cp_tree_equal): Likewise.
	* typeck.c (common_type): Likewise.
	(comp_array_types): Likewise.  Get issues involving unknown array
	bounds right.
	(comptypes): Update comments.  Use new flags.
	(comp_target_types): Use new macros.
	(compparms): Likewise.
	(comp_target_parms): Likewise.
	(string_conv_p): Likewise.
	(build_component_ref): Likewise.
	(build_indirect_ref): Likewise.
	(build_conditional_expr): Likewise.
	(build_static_cast): Likewise.
	(build_reinterpret_cast): Likewise.
	(build_const_cast): Likewise.
	(build_modify_expr): Likewise.
	(convert_for_assignment): Likewise.
	(comp_ptr_ttypes_real): Likewise.
	(ptr_reasonably_similar): Likewise.
	(comp_ptr_ttypes_const): Likewise.

From-SVN: r23490
1998-11-01 15:45:11 +00:00
Mark Mitchell 8a72a04676 decl2.c (delete_sanity): Pass integer_zero_node, not integer_two_node, to build_vec_delete.
* decl2.c (delete_sanity): Pass integer_zero_node, not
	integer_two_node, to build_vec_delete.
	* init.c (build_array_eh_cleanup): Remove.
	(expand_vec_init_try_block): New function.
	(expand_vec_init_catch_clause): Likewise.
	(build_vec_delete_1): Don't deal with case that auto_delete_vec
	might be integer_two_node anymore.
	(expand_vec_init): Rework for initialization-correctness and
	exception-correctness.
	* typeck2.c (process_init_constructor): Make mutual exclusivity
	of cases more obvious.

From-SVN: r23455
1998-10-30 11:17:50 +00:00