Commit Graph

107 Commits

Author SHA1 Message Date
Jason Merrill 0c4b14c4d3 [multiple changes]
Mon Sep 29 11:05:54 1997  Alexandre Oliva  <oliva@dcc.unicamp.br>

	* lang-options.h: new -Wold-style-cast flag.
	* cp-tree.h (warn_old_style_cast): new variable.
	* decl2.c (warn_old_style_cast): ditto.
	(lang_decode_option): support -Wold-style-cast.
	(reparse_absdcl_as_casts): produce old-style-cast warning.

Mon Sep 29 09:20:53 1997  Benjamin Kosnik  <bkoz@rhino.cygnus.com>

	* decl.c (cp_finish_decl): Allow expand_aggr_init to set
 	TREE_USED, reset value based on already_used.

	* init.c (expand_member_init): Revert change.

From-SVN: r15793
1997-09-29 15:05:04 -04:00
Jason Merrill 893de33c13 cp-tree.h, [...]: Lose DECL_C_STATIC and DECL_PUBLIC.
* cp-tree.h, decl.c, decl2.c, pt.c:
 	Lose DECL_C_STATIC and DECL_PUBLIC.  Don't pretend statics are public.

	* decl2.c (lang_decode_option): Add missing ;.

From-SVN: r15789
1997-09-29 12:08:34 -04:00
Jason Merrill 386b8a85a6 [multiple changes]
Sat Sep 27 16:22:48 1997  Jason Merrill  <jason@yorick.cygnus.com>

	* friend.c (do_friend): Disable injection for all template-derived
 	decls.
	* decl2.c (lang_decode_option): Handle -fguiding-decls.
	* parse.y (notype_template_declarator): New nonterminal.
	(direct_notype_declarator): Use it.
	(complex_direct_notype_declarator): Likewise.
	(object_template_id): Accept any kind of identifier after TEMPLATE.
	(notype_qualified_id): Don't add template declarators here.

Sat Sep 27 16:21:58 1997  Mark Mitchell  <mmitchell@usa.net>

        * call.c (add_template_candidate): Add explicit_targs parameter.
        (build_scoped_method_call): Use it.
        (build_overload_call_real): Likewise.
        (build_user_type_conversion_1): Likewise.
        (build_new_function_call): Likewise.
        (build_object_call): Likewise.
        (build_new_op): Likewise.
        (build_new_method_call): Likewise.
        (build_new_function_call): Handle TEMPLATE_ID_EXPR.
        (build_new_method_call): Likewise.

        * class.c (finish_struct_methods): Add specialization pass to
        determine which methods were specializing which other methods.
        (instantiate_type): Handle TEMPLATE_ID_EXPR.

        * cp-tree.def (TEMPLATE_ID_EXPR): New tree code.

        * cp-tree.h (name_mangling_version): New variable.
	(flag_guiding_decls): Likewise.
        (build_template_decl_overload): New function.
        (begin_specialization): Likewise.
        (reset_specialization): Likewise.
        (end_specialization): Likewise.
        (determine_explicit_specialization): Likewise.
        (check_explicit_specialization): Likewise.
        (lookup_template_function): Likewise.
        (fn_type_unification): Add explicit_targs parameter.
        (type_unification): Likewise.

        * decl.c (duplicate_decls): Add smarts for explicit
        specializations.
        (grokdeclarator): Handle TEMPLATE_ID_EXPR, and function
        specializations.
        (grokfndecl): Call check_explicit_specialization.

        * decl2.c (lang_decode_option): Handle -fname-mangling-version.
        (build_expr_from_tree): Handle TEMPLATE_ID_EXPR.
        (check_classfn): Handle specializations.

        * error.c (dump_function_name): Print specialization arguments.

	* friend.c (do_friend): Don't call pushdecl for template
        instantiations.

        * init.c (build_member_call): Handle TEMPLATE_ID_EXPR.

        * lang-options.h: Add -fname-mangling-version, -fguiding-decls,
	and -fno-guiding-decls.

        * lex.c (identifier_type): Return PFUNCNAME for template function
        names.

        * method.c (build_decl_overload_real): New function.
        (build_template_parm_names): New function.
        (build_overload_identifier): Use it.
        (build_underscore_int): New function.
        (build_overload_int): Use it.  Add levels for template
        parameters.
        (build_overload_name): Likewise.  Also, handle TYPENAME_TYPEs.
        (build_overload_nested_names): Handle template type parameters.
        (build_template_decl_overload): New function.

        * parse.y (YYSTYPE): New ntype member.
        (nested_name_specifier): Use it.
        (nested_name_specifier_1): Likewise.
        (PFUNCNAME): New token.
        (template_id, object_template_id): New non-terminals.
        (template_parm_list): Note specializations.
        (template_def): Likewise.
        (structsp): Likewise.
        (fn.def2): Handle member template specializations.
        (component_decl_1): Likewise.
        (direct_notype_declarator): Handle template-ids.
        (component_decl_1): Likewise.
        (direct_notype_declarator): Handle template-ids.
        (primary): Handle TEMPLATE_ID_EXPR, and template-ids.

        * pt.c (processing_specializations): New variable.
        (template_header_count): Likewise.
        (type_unification_real): New function.
        (processing_explicit_specialization): Likewise.
        (note_template_header): Likewise.
        (is_member_template): Handle specializations.
        (end_template_decl): Call reset_specialization.
        (push_template_decl): Handle member template specializations.
        (tsubst): Likewise.
        (tsubst_copy): Handle TEMPLATE_ID_EXPR.
        (instantiate_template): Handle specializations.
        (instantiate_decl): Likewise.
        (fn_type_unification): Handle explicit_targs.
        (type_unification): Likewise.  Allow incomplete unification
        without an error message, if allow_incomplete.
        (get_bindings): Use new calling sequence for fn_type_unification.

        * spew.c (yylex): Handle PFUNCNAME.

        * tree.c (is_overloaded_fn): Handle TEMPLATE_ID_EXPR.
        (really_overloaded_fn): Likewise.
        (get_first_fn): Handle function templates.

        * typeck.c (build_x_function_call): Use really_overloaded_fn.
        Handle TEMPLATE_ID_EXPR.
        (build_x_unary_op): Likewise.
        (build_unary_op): Likewise.
        (mark_addressable): Templates whose address is taken are marked
        as used.

From-SVN: r15774
1997-09-28 15:16:59 -04:00
Jason Merrill 0021b564f4 dwarf2 EH support
From-SVN: r15255
1997-09-10 14:00:28 -04:00
Jason Merrill 98c1c66880 class.c (grow_method): Remove check for redeclaration.
* class.c (grow_method): Remove check for redeclaration.

Fri Sep  5 01:37:17 1997  Mark Mitchell  <mmitchell@usa.net>

	* cp-tree.h (INNERMOST_TEMPLATE_PARMS): New macro.
	(DECL_INNERMOST_TEMPLATE_PARMS): Likewise.
	(PRIMARY_TEMPLATE_P): Use it.
	* call.c (build_overload_call_real): Use it.
	* class.c (instantiate_type): Likewise.
	* decl.c (decls_match): Likewise.
	* method.c (build_overload_identifier): Likewise.
	* pt.c (push_template_decl): Likewise.
	(classtype_mangled_name): Likewise.
	(lookup_template_class): Likewise.

	* cp-tree.h (DECL_NTPARMS): Change name from DECL_NT_PARMS to
	DECL_NTPARMS to conform to usage elsewhere.
	* call.c (add_template_candidate): Likewise.
	* class.c (instantiate_type): Likewise.
	* pt.c (instantiate_template): Likewise.
	(get_bindings): Likewise.

	* class.c (grow_method): Use DECL_FUNCTION_TEMPLATE_P instead of
	is_member_template.

	* pt.c (unify): Undo changes to allow multiple levels of template
	parameters.
	(type_unification): Likewise.
	(fn_type_unification): Likewise.
	(get_class_bindings): Likewise.
	* cp-tree.h (Likewise).

	* decl.c (replace_defarg): Check that the type of the default
	parameter does not invlove a template type before complaining
	about the initialization.

	* error.c (dump_expr): Deal with template constant parameters in
	member templates correctly.

	* pt.c (is_member_template): Deal with class specializations
	correctly.
	(tsubst): Handle "partial instantiation" of member templates
	correctly.

Wed Sep  3 12:30:24 1997  Mark Mitchell  <mmitchell@usa.net>

	* pt.c (type_unification): Change calling squence to allow for
	multiple levels of template parameters.
	(tsubst_expr): Likewise.
	(tsubst): Likewise.
	(tsubst_copy): Likewise.
	(instantiate_template): Likewise.
	(unify): Likewise.
	* call.c (build_overload_call_real): Use it.
	(add_builtin_candidate): Use it.
	(build_new_method_call): Use it.
	* class.c (instantiate_type): Use it.
	* decl.c (grokdeclarator): Use it.
	* decl2.c (finish_file): Use it.
	* method.c (build_overload_identifier): Use it.

	* call.c (add_template_candidate):  Add additional parameter for
	the function return type.  Call fn_type_unification istead of
	type_unification.
	(build_user_type_conversion_1): Handle member templates.
	(build_new_function_call): Likewise.
	(build_new_op): Likewise.
	(build_new_method_call): Likewise.

	* class.c (grow_method): Don't give an error message indicating
 	that two member templates with the same name are ambiguous.
	(finish_struct): Treat member template functions just like member
 	functions.

	* cp-tree.h (check_member_template): Add declaration.
	(begin_member_template_processing): Likewise.
	(end_member_template_processing): Likewise.
	(fn_type_unification): Likewise.
	(is_member_template): Likewise.
	(tsubst): Change prototype.
	(tsubst_expr): Likewise.
	(tsubst_copy): Likewise.
	(instantiate_template): Likewise.
	(get_bindings): Likewise.

	* decl.c (decls_match): Handle multiple levels of template
	parameters.
	(pushdecl): Handle template type params just like other type
	declarations.
	(push_class_level_binding): Return immediately if the
	class_binding_level is NULL.
	(grokfndecl): If check_classfn() returns a member_template, use
	the result of the template, not the template itself.

	* decl2.c (check_member_template): New function.  Check to see
	that the entity declared to be a member template can be one.
	(check_classfn): Allow redeclaration of member template functions
	with different types; the new functions can be specializations or
	explicit instantiations.

	* error.c (dump_decl): Handle multiple levels of template
	parameters.
	(dump_function_decl): Update to handle function	templates.

	* lex.c (do_pending_inlines): Set up template parameter context
	for member templates.
	(process_next_inline): Likewise.

	* method. (build_overload_identifier): Adjust for multiple levels
	of template parameters.

	* parse.y (fn.def2): Add member templates.
	(component_decl_1): Likewise.

	* pt.c (begin_member_template_processing): New function.
	(end_member_template_processing): Likewise.
	(is_member_template): Likewise.
	(fn_type_unification): Likewise.
	(current_template_parms): Return a vector of all the template
	parms, not just the innermost level of parms.
	(push_template_decl): Deal with the possibility of member
	templates.
	(lookup_template_class): Likewise.
	(uses_template_parms): Likewise.
	(tsubst): Modify processing to TEMPLATE_TYPE_PARM and
	TEMPLATE_CONST_PARM to deal with multiple levels of template
	arguments.   Add processing of TEMPLATE_DECL to produce new
	TEMPLATE_DECLs from old ones.
	(do_decl_instantiation): Handle member templates.

	* search.c (lookup_fnfields_1): Handle member template conversion
	operators.

	* tree.c (cp_tree_equal): Check the levels, as well as the
	indices, of TEMPLATE_CONST_PARMs.

	* typeck.c (comptypes): Check the levels, as well as the indices,
	fo TEMPLATE_TYPE_PARMs.
	(build_x_function_call): Treat member templates like member
	functions.

Member templates.

From-SVN: r15130
1997-09-06 04:10:07 -04:00
Jason Merrill c1bc6829b4 typeck.c (c_expand_return): Always convert_for_initialization before checking for returning a pointer to local.
* typeck.c (c_expand_return): Always convert_for_initialization
 	before checking for returning a pointer to local.

From-SVN: r15064
1997-09-03 16:01:18 -04:00
Jason Merrill 7e3af3746e call.c (build_new_op): Strip leading REF_BIND from first operand to builtin operator.
* call.c (build_new_op): Strip leading REF_BIND from first operand
	to builtin operator.

	* decl2.c (mark_vtable_entries): Mark abort_fndecl as used when we
	use its RTL.

From-SVN: r15023
1997-09-01 17:01:30 -04:00
Jason Merrill 49c249e1c8 [multiple changes]
Wed Aug 20 17:25:08 1997  Jason Merrill  <jason@yorick.cygnus.com>

	* call.c (is_subseq): Don't try to be clever.

Wed Aug 20 03:13:36 1997  H.J. Lu  (hjl@gnu.ai.mit.edu)

	* parse.y, pt.c: Include "except.h".
	* call.c, class.c, class.h, cp-tree.h, cvt.c, decl.c, decl2.c,
 	error.c, except.c, expr.c, friend.c, g++spec.c, init.c, input.c,
 	lex.c, lex.h, method.c, parse.y, pt.c, repo.c, rtti.c, search.c,
 	sig.c, spew.c, tree.c, typeck.c, typeck2.c, xref.c: Finish
 	prototyping.

Wed Aug 20 01:34:40 1997  Jason Merrill  <jason@yorick.cygnus.com>

	* decl2.c (mark_vtable_entries): Instead of replacing pure
	virtuals with a reference to __pure_virtual, copy the decl and
	change the RTL.

From-SVN: r14868
1997-08-20 20:50:39 -04:00
Jason Merrill f62dbf031d merge
From-SVN: r14853
1997-08-19 18:49:24 -04:00
Jason Merrill da20811c09 merge
From-SVN: r14852
1997-08-19 18:37:19 -04:00
Mike Stump 7834ab3923 92th Cygnus<->FSF merge
From-SVN: r14401
1997-07-08 00:17:49 +00:00
Mike Stump 6633d6367f 91th Cygnus<->FSF quick merge
From-SVN: r14253
1997-06-18 02:25:37 +00:00
Mike Stump eb4484594f 91th Cygnus<->FSF quick merge
From-SVN: r14007
1997-05-02 01:42:58 +00:00
Mike Stump eb66be0e6c 91th Cygnus<->FSF merge
From-SVN: r13971
1997-04-23 22:39:53 +00:00
Mike Stump bd6dd8453c 90th Cygnus<->FSF quick merge
From-SVN: r13831
1997-04-02 03:58:33 +00:00
Mike Stump e9f32eb503 90th Cygnus<->FSF quick merge
From-SVN: r13629
1997-02-12 20:23:55 +00:00
Mike Stump 824b9a4c45 90th Cygnus<->FSF quick merge
From-SVN: r13604
1997-02-04 02:31:49 +00:00
Mike Stump d2e5ee5c70 90th Cygnus<->FSF quick merge
From-SVN: r13321
1996-12-18 02:46:25 +00:00
Mike Stump faf5394a1b 90th Cygnus<->FSF quick merge
From-SVN: r13319
1996-12-18 01:44:21 +00:00
Mike Stump 9a3b49acbc 90th Cygnus<->FSF quick merge
From-SVN: r13141
1996-11-12 19:49:48 +00:00
Mike Stump 691c003dcc 90th Cygnus<->FSF quick merge
From-SVN: r13082
1996-10-31 17:08:58 +00:00
Mike Stump d22c85969b 89th Cygnus<->FSF quick merge
From-SVN: r12953
1996-10-11 20:19:33 +00:00
Mike Stump 5156628f9f 89th Cygnus<->FSF quick merge
From-SVN: r12883
1996-09-30 21:34:04 +00:00
Mike Stump 7fcdf4c26b 89th Cygnus<->FSF quick merge
From-SVN: r12738
1996-09-18 17:20:21 +00:00
Mike Stump c11b6f21eb merging
From-SVN: r12700
1996-09-12 19:19:15 +00:00
Mike Stump d11ad92ebe 88 Cygnus<->FSF merge
From-SVN: r12674
1996-08-26 20:32:48 +00:00
Jason Merrill 73aad9b9ff 87th Cygnus<->FSF quick merge
From-SVN: r12630
1996-08-13 15:39:22 +00:00
Mike Stump c73964b2fb 87th Cygnus<->FSF quick merge
From-SVN: r12606
1996-08-08 22:54:56 +00:00
Mike Stump 6467930b06 *** empty log message ***
From-SVN: r12602
1996-08-08 22:08:30 +00:00
Mike Stump 594740f365 87th Cygnus<->FSF quick merge
From-SVN: r12535
1996-07-19 21:46:24 +00:00
Mike Stump e92cc02916 87 Cygnus<->FSF merge
From-SVN: r12424
1996-07-11 01:13:25 +00:00
Mike Stump 4ac1474483 86th Cygnus<->FSF quick merge
From-SVN: r11974
1996-05-16 18:43:00 +00:00
Doug Evans 574baa641d decl2.c (finish_vtable_vardecl): Surround DECL_ONE_ONLY with ifdef.
* decl2.c (finish_vtable_vardecl): Surround DECL_ONE_ONLY with ifdef.
	(finish_file): Likewise.

From-SVN: r11970
1996-05-11 11:39:49 +00:00
Mike Stump a50f091815 86th Cygnus<->FSF quick merge
From-SVN: r11952
1996-05-07 18:54:10 +00:00
Jason Merrill 809c8c30be 86th Cygnus<->FSF quick merge
From-SVN: r11914
1996-05-02 16:31:04 +00:00
Mike Stump 46b02c6d61 86th Cygnus<->FSF quick merge
From-SVN: r11905
1996-04-30 18:29:47 +00:00
Jason Merrill 7303f45c75 Fixes
From-SVN: r11897
1996-04-26 21:36:40 +00:00
Mike Stump 67d743fe77 86th Cygnus<->FSF quick merge
From-SVN: r11877
1996-04-24 18:30:21 +00:00
Mike Stump a80e41955a 86th Cygnus<->FSF quick merge
From-SVN: r11850
1996-04-19 00:48:03 +00:00
Mike Stump 6b5fbb552b 86th Cygnus<->FSF quick merge
From-SVN: r11710
1996-04-12 23:55:07 +00:00
Mike Stump 909e536aa5 85th Cygnus<->FSF quick merge
From-SVN: r11597
1996-03-22 23:11:55 +00:00
Mike Stump fc37869868 85th Cygnus<->FSF quick merge
From-SVN: r11587
1996-03-21 19:46:11 +00:00
Mike Stump 357a4089d9 85th Cygnus<->FSF quick merge
From-SVN: r11506
1996-03-09 20:23:30 +00:00
Mike Stump e76a26469d 85th Cygnus<->FSF merge
From-SVN: r11497
1996-03-08 00:38:10 +00:00
Mike Stump 5566b478bd 83rd Cygnus<->FSF merge
From-SVN: r11362
1996-02-28 22:01:56 +00:00
Mike Stump cffa872980 82nd Cygnus<->FSF merge
From-SVN: r11328
1996-02-20 20:35:10 +00:00
Mike Stump 2ee887f272 81st Cygnus<->FSF merge
From-SVN: r11187
1996-02-09 22:43:25 +00:00
Mike Stump 9e9ff70986 80th Cygnus<->FSF merge
From-SVN: r11150
1996-02-01 19:32:00 +00:00
Mike Stump 455376771f 79th Cygnus<->FSF merge
From-SVN: r11082
1996-01-22 19:49:02 +00:00
Mike Stump be99da7733 78th Cygnus<->FSF merge
From-SVN: r11039
1996-01-17 18:57:55 +00:00