From c32381b1878298d0d3e5f6625ed30b9d7b523fef Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Tue, 7 Oct 1997 03:50:21 -0400 Subject: [PATCH] decl.c (duplicate_decls): Don't warn about template instances. * decl.c (duplicate_decls): Don't warn about template instances. * typeck.c (mark_addressable): Lose ancient code that unsets DECL_EXTERNAL. * pt.c (do_decl_instantiation): Lose support for instantiating non-templates. * call.c (build_new_function_call): Fix handling of null explicit template args. (build_new_method_call): Likewise. Mon Oct 6 23:44:34 1997 Mark Mitchell * method.c (build_underscore_int): Fix typo. From-SVN: r15851 --- gcc/cp/ChangeLog | 20 ++++++++++++++++++++ gcc/cp/call.c | 8 ++++++-- gcc/cp/decl.c | 5 +++-- gcc/cp/method.c | 2 +- gcc/cp/pt.c | 14 ++------------ gcc/cp/typeck.c | 9 --------- 6 files changed, 32 insertions(+), 26 deletions(-) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index fbb7cc19b3c..1fdd09216c2 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,21 @@ +Tue Oct 7 00:48:36 1997 Jason Merrill + + * decl.c (duplicate_decls): Don't warn about template instances. + + * typeck.c (mark_addressable): Lose ancient code that unsets + DECL_EXTERNAL. + + * pt.c (do_decl_instantiation): Lose support for instantiating + non-templates. + + * call.c (build_new_function_call): Fix handling of null explicit + template args. + (build_new_method_call): Likewise. + +Mon Oct 6 23:44:34 1997 Mark Mitchell + + * method.c (build_underscore_int): Fix typo. + 1997-10-06 Brendan Kehoe * tree.c (print_lang_statistics): #if 0 call to @@ -5,6 +23,8 @@ Mon Oct 6 09:27:29 1997 Jason Merrill + * decl2.c (finish_file): Move dump_tree_statistics to end. + * pt.c (instantiate_decl): Look for the original template. (tsubst): Set DECL_IMPLICIT_INSTANTIATION on partial instantiations of member templates. diff --git a/gcc/cp/call.c b/gcc/cp/call.c index e232a382d8b..dc310022c1b 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -4484,11 +4484,13 @@ build_new_function_call (fn, args, obj) { struct z_candidate *candidates = 0, *cand; tree explicit_targs = NULL_TREE; + int template_only = 0; if (TREE_CODE (fn) == TEMPLATE_ID_EXPR) { explicit_targs = TREE_OPERAND (fn, 1); fn = TREE_OPERAND (fn, 0); + template_only = 1; } if (obj == NULL_TREE && really_overloaded_fn (fn)) @@ -4510,7 +4512,7 @@ build_new_function_call (fn, args, obj) (candidates, t, explicit_targs, args, NULL_TREE, LOOKUP_NORMAL); } - else if (explicit_targs == NULL_TREE) + else if (! template_only) candidates = add_function_candidate (candidates, t, args, LOOKUP_NORMAL); } @@ -5466,11 +5468,13 @@ build_new_method_call (instance, name, args, basetype_path, flags) tree pretty_name; tree user_args = args; tree templates = NULL_TREE; + int template_only = 0; if (TREE_CODE (name) == TEMPLATE_ID_EXPR) { explicit_targs = TREE_OPERAND (name, 1); name = TREE_OPERAND (name, 0); + template_only = 1; } /* If there is an extra argument for controlling virtual bases, @@ -5574,7 +5578,7 @@ build_new_method_call (instance, name, args, basetype_path, flags) TREE_TYPE (name), LOOKUP_NORMAL); } - else if (explicit_targs == NULL_TREE) + else if (! template_only) candidates = add_function_candidate (candidates, t, this_arglist, flags); diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index e9b8de3f372..57455d2fcd3 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -2623,8 +2623,9 @@ duplicate_decls (newdecl, olddecl) } } - if (TREE_CODE (olddecl) == FUNCTION_DECL - && ! DECL_USE_TEMPLATE (olddecl)) + if (DECL_USE_TEMPLATE (olddecl)) + ; + else if (TREE_CODE (olddecl) == FUNCTION_DECL) { tree t1 = TYPE_ARG_TYPES (TREE_TYPE (olddecl)); tree t2 = TYPE_ARG_TYPES (TREE_TYPE (newdecl)); diff --git a/gcc/cp/method.c b/gcc/cp/method.c index 69d1670e7a7..3b70743c32c 100644 --- a/gcc/cp/method.c +++ b/gcc/cp/method.c @@ -424,7 +424,7 @@ build_underscore_int (int i) OB_PUTC ('_'); icat (i); if (i > 9) - OB_PUTS ('_'); + OB_PUTC ('_'); } /* Encoding for an INTEGER_CST value. */ diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 95109cf93ec..cfa516496a8 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -4226,24 +4226,14 @@ do_decl_instantiation (declspecs, declarator, storage) fn = TREE_VALUE (fn); for (; fn; fn = DECL_CHAIN (fn)) - if (decls_match (fn, decl) && DECL_DEFER_OUTPUT (fn)) - { - result = fn; - break; - } - else if (TREE_CODE (fn) == TEMPLATE_DECL) + if (TREE_CODE (fn) == TEMPLATE_DECL) templates = decl_tree_cons (NULL_TREE, fn, templates); } } else if (name = DECL_NAME (decl), fn = IDENTIFIER_GLOBAL_VALUE (name), fn) { for (fn = get_first_fn (fn); fn; fn = DECL_CHAIN (fn)) - if (decls_match (fn, decl) && DECL_DEFER_OUTPUT (fn)) - { - result = fn; - break; - } - else if (TREE_CODE (fn) == TEMPLATE_DECL) + if (TREE_CODE (fn) == TEMPLATE_DECL) templates = decl_tree_cons (NULL_TREE, fn, templates); } diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index 971cab4a17a..797cd3d4c3e 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -4772,15 +4772,6 @@ mark_addressable (exp) be non-zero in the case of processing a default function. The second may be non-zero in the case of a template function. */ x = DECL_MAIN_VARIANT (x); - if ((DECL_THIS_INLINE (x) || DECL_PENDING_INLINE_INFO (x)) - && (DECL_CONTEXT (x) == NULL_TREE - || TREE_CODE_CLASS (TREE_CODE (DECL_CONTEXT (x))) != 't' - || ! CLASSTYPE_INTERFACE_ONLY (DECL_CONTEXT (x)))) - { - mark_inline_for_output (x); - if (x == current_function_decl) - DECL_EXTERNAL (x) = 0; - } if (DECL_TEMPLATE_INFO (x) && !DECL_TEMPLATE_SPECIALIZATION (x)) mark_used (x); TREE_ADDRESSABLE (x) = 1; -- 2.30.2