Commit Graph

14 Commits

Author SHA1 Message Date
Jason Merrill
cb99b4a0ce x
From-SVN: r21409
1998-07-27 07:09:14 -04:00
Jason Merrill
d1fec18074 * pt.c (coerce_template_parms): Also complain about local enums.
From-SVN: r21363
1998-07-24 10:02:32 -04:00
Jason Merrill
570221c201 friend.c (is_friend): Fix access control for local classes.
* friend.c (is_friend): Fix access control for local classes.
	* class.c (is_empty_class): New fn.
	* call.c (build_call): Don't pass empty class objects to a function.

From-SVN: r18933
1998-04-01 12:05:25 -05:00
Mark Mitchell
e1467ff26b call.c (add_template_candidate_real): New function.
* call.c (add_template_candidate_real): New function.
	(add_template_candidate): Use it.
	(add_template_conv_candidate): Likewise.
	(joust): Pass extra argument to more_specialized.
	* class.c (instantiate_type): Handle a single FUNCTION_DECL.
	(is_local_class): Remove.
	(finish_struct): Check TI_PENDING_SPECIALIZATION_FLAG.
	* cp-tree.h (is_local_class): Remove.
	(perform_array_to_pointer_conversion): Likewise.
	(finish_member_template_decl): Add.
	(check_explicit_specialization): Return a tree, not an int.
	(more_specialized): Take additional argument.
	(get_bindings): Likewise.
	(TI_PENDING_SPECIALIZATION_FLAG): New macro.
	* cvt.c (perform_qualification_conversions): Use comp_ptr_ttypes.
	(perform_array_to_pointer_conversion): Remove.
	* decl.c (saved_scope): Add processing_specialization,
	processing_explicit_instantiation fields.
	(maybe_push_to_top_level): Save them.
	(pop_from_top_level): Restore them.
	(grokfndecl): Use new return value from
	check_explicit_specialization.
	(start_decl): Don't check flag_guiding_decls before pushing
	decls.
	(cp_finish_decl): Remove previous (bogus) change.
	(grok_declarator): Use decl_function_context rather than
	is_local_class.
	* decl2.c (finish_file): Pass extra argument to get_bindings.
	(build_expr_from_tree): Let build_x_component_ref check
	validity of arguments rather than doing it here.
	* lex.c (cons_up_default_function): Remove code fooling with
	processing_specialization, processing_explicit_instantiation
	flags, as that is now done in {maybe_push_top,pop_from}_top_level.
	* method.c (build_overload_identifier): Mangle local classes in
	template functions correctly.
	* parse.y (finish_member_template_decl): Move to pt.c.
	* pt.c (finish_member_template_decl): Moved here from parse.y.
	(print_candidates): New function.
	(determine_specialization): Change interface.  Properly look for
	most specialized versions of template candidates.
	(check_explicit_specialization): Fully process explicit
	instantiations.
	(push_template_decl): Avoid looking at CLASSTYPE fields in
	FUNCTION_DECLS.
	(determine_overloaded_function): Remove.
	(convert_nontype_argument): Change name from
	convert_nontype_parameter.  Use determine_overloaded_function
	instead of instantiate_type.
	(mangle_class_name_for_template): Handle type contexts as well as
	function contexts.
	(classtype_mangled_name): Likewise.
	(lookup_template_class): Likewise.
	(tsubst): Likewise.
	(more_specialized): Take explict template arguments as a
	parameter.
	(most_specialized): Likewise.
	(get_bindings): Likewise.  Check that return types match before
	proclaiming a function a match.
	(do_decl_instantiation): Remove code searching for function to
	instantiate; that is now done in check_explicit_specialization.
	(add_maybe_template): Pass extra argument to get_bindings.
	* tree.c (really_overloaded_fn): Use is_overloaded_fn to simplify
	implementation.
	* typeck.c (build_component_ref): Check for invalid arguments.

From-SVN: r17512
1998-01-27 15:47:56 -05:00
Jason Merrill
be34355626 decl.c (cp_finish_decl): When bailing on a comdat variable, also unset DECL_NOT_REALLY_EXTERN.
* decl.c (cp_finish_decl): When bailing on a comdat variable, also
	unset DECL_NOT_REALLY_EXTERN.

From-SVN: r17477
1998-01-25 08:33:39 -05:00
Jason Merrill
19754d4cf6 typeck2.c (digest_init): Make copies where appropriate.
* typeck2.c (digest_init): Make copies where appropriate.

	* decl2.c (delete_sanity): resolve_offset_ref.

From-SVN: r16727
1997-11-26 04:56:56 -05: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
405a745b2e parse.y (member_init): Also imply typename here.
* parse.y (member_init): Also imply typename here.  Remove ancient
	extension for initializing base members.

From-SVN: r15720
1997-09-26 03:24:48 -04:00
Jason Merrill
1e60a96e07 fix thinko
From-SVN: r15719
1997-09-26 03:03:44 -04:00
Jason Merrill
3041f77a20 update
From-SVN: r15687
1997-09-24 00:51:57 -04:00
Jason Merrill
5c825fc20b decl.c (store_parm_decls): last_parm_cleanup_insn is the insn after the exception spec.
* decl.c (store_parm_decls): last_parm_cleanup_insn is the insn
 	after the exception spec.

From-SVN: r15497
1997-09-16 17:08:30 -04:00
Jason Merrill
8e69329a82 * call.c (null_ptr_cst_p): Remove support for (void*)0.
From-SVN: r15022
1997-09-01 16:07:22 -04:00
Jason Merrill
8eeda2ecd5 lex.c (real_yylex): Refer to __complex instead of complex.
* lex.c (real_yylex): Refer to __complex instead of complex.

-Wed Jul 16 15:57:42 1997  Benjamin Kosnik  <bkoz@rhino.cygnus.com>
-
-       * parse.y (empty_parms): Only use VOID_LIST_NODE for the PARMS if
-       we're in a C++ struct/class, not if we're doing xtern "C"'.
-

and regenerate parse.c.

From-SVN: r14885
1997-08-21 21:52:56 -04:00
Jason Merrill
fb52f6de35 release notes
From-SVN: r14883
1997-08-21 20:30:16 -04:00