]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
decl.c (duplicate_decls): Don't warn about template instances.
authorJason Merrill <jason@gcc.gnu.org>
Tue, 7 Oct 1997 07:50:21 +0000 (03:50 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Tue, 7 Oct 1997 07:50:21 +0000 (03:50 -0400)
* 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  <mmitchell@usa.net>

* method.c (build_underscore_int): Fix typo.

From-SVN: r15851

gcc/cp/ChangeLog
gcc/cp/call.c
gcc/cp/decl.c
gcc/cp/method.c
gcc/cp/pt.c
gcc/cp/typeck.c

index fbb7cc19b3cb4d4bc21f226cffae4bf9846e8674..1fdd09216c26b02990248e36fbe7dd7f70d7c63e 100644 (file)
@@ -1,3 +1,21 @@
+Tue Oct  7 00:48:36 1997  Jason Merrill  <jason@yorick.cygnus.com>
+
+       * 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  <mmitchell@usa.net>
+
+       * method.c (build_underscore_int): Fix typo.
+
 1997-10-06  Brendan Kehoe  <brendan@lisa.cygnus.com>
 
        * tree.c (print_lang_statistics): #if 0 call to
@@ -5,6 +23,8 @@
 
 Mon Oct  6 09:27:29 1997  Jason Merrill  <jason@yorick.cygnus.com>
 
+       * 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.
index e232a382d8b9a351ec660ff1fbfe63e6c94b18ba..dc310022c1b5120804e2d7d7eb4e093de3925d61 100644 (file)
@@ -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);
 
index e9b8de3f372a4fbde22129c8eea6808011a84d76..57455d2fcd3178054b536a6c6e3e8814c77a34dd 100644 (file)
@@ -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));
index 69d1670e7a72177d45ddcfd49a98fdad8b04267f..3b70743c32cb78f64dc36d8323d64d7a4cfdbe42 100644 (file)
@@ -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.  */
index 95109cf93ec164d37bab649829beff06cbfaa588..cfa516496a876ed754dbfed5e6dc31706d1871a7 100644 (file)
@@ -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);
     }
 
index 971cab4a17aa3722d83990d7e7e59306e4b18293..797cd3d4c3e5f3b4bf0fe37b89595b6d1a7a2ca2 100644 (file)
@@ -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;