OSDN Git Service

90th Cygnus<->FSF quick merge
authormrs <mrs@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 6 Feb 1997 19:32:49 +0000 (19:32 +0000)
committermrs <mrs@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 6 Feb 1997 19:32:49 +0000 (19:32 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@13612 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/cp/ChangeLog
gcc/cp/new.cc
gcc/cp/pt.c

index 9b484f5..a6d564f 100644 (file)
@@ -1,7 +1,17 @@
+Tue Feb  4 11:28:24 1997  Jason Merrill  <jason@yorick.cygnus.com>
+
+       * pt.c (unify, case TEMPLATE_CONST_PARM): Use cp_tree_equal.
+
+       * pt.c (tsubst): Put it back for -fno-ansi-overloading.
+
+Mon Feb  3 18:41:12 1997  Jason Merrill  <jason@yorick.cygnus.com>
+
+       * pt.c (tsubst, case FUNCTION_DECL): Lose obsolete code that
+       smashes together template and non-template decls of the same
+       signature.
+
 Thu Jan 30 19:18:00 1997  Jason Merrill  <jason@yorick.cygnus.com>
 
-       * decl.c (lookup_name_real): Also build a TYPENAME_TYPE for nested
-       classes.
        * pt.c (tsubst): Don't recurse for the type of a TYPENAME_TYPE.
 
 Wed Jan 29 11:40:35 1997  Brendan Kehoe  <brendan@lisa.cygnus.com>
index b538689..0db3497 100644 (file)
@@ -1,7 +1,30 @@
 // Implementation file for the -*- C++ -*- dynamic memory management header.
 // Copyright (C) 1996 Free Software Foundation
+
 // This file is part of GNU CC.
 
+// GNU CC is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// GNU CC is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with GNU CC; see the file COPYING.  If not, write to
+// the Free Software Foundation, 59 Temple Place - Suite 330,
+// Boston, MA 02111-1307, USA. 
+
+// As a special exception, if you link this library with other files,
+// some of which are compiled with GCC, to produce an executable,
+// this library does not by itself cause the resulting executable
+// to be covered by the GNU General Public License.
+// This exception does not however invalidate any other reasons why
+// the executable file might be covered by the GNU General Public License.
+
 #pragma implementation "new"
 #include "new"
 
index 58cb324..7e8c184 100644 (file)
@@ -1483,7 +1483,7 @@ tsubst (t, args, nargs, in_decl)
        /* We do NOT check for matching decls pushed separately at this
            point, as they may not represent instantiations of this
            template, and in any case are considered separate under the
-           discrete model.  */
+           discrete model.  Instead, see add_maybe_template.  */
 
        r = copy_node (t);
        copy_lang_decl (r);
@@ -1542,7 +1542,7 @@ tsubst (t, args, nargs, in_decl)
          grok_op_properties (r, DECL_VIRTUAL_P (r), DECL_FRIEND_P (r));
 
        /* Look for matching decls for the moment.  */
-       if (! member)
+       if (! member && ! flag_ansi_overloading)
          {
            tree decls = lookup_name_nonclass (DECL_NAME (t));
            tree d = NULL_TREE;
@@ -2747,31 +2747,16 @@ unify (tparms, targs, ntparms, parm, arg, nsubsts, strict)
     case TEMPLATE_CONST_PARM:
       (*nsubsts)++;
       idx = TEMPLATE_CONST_IDX (parm);
-      if (targs[idx] == arg)
-       return 0;
-      else if (targs[idx])
+      if (targs[idx])
        {
-         tree t = targs[idx];
-         if (TREE_CODE (t) == TREE_CODE (arg))
-           switch (TREE_CODE (arg))
-             {
-             case INTEGER_CST:
-               if (tree_int_cst_equal (t, arg))
-                 return 0;
-               break;
-             case REAL_CST:
-               if (REAL_VALUES_EQUAL (TREE_REAL_CST (t), TREE_REAL_CST (arg)))
-                 return 0;
-               break;
-             /* STRING_CST values are not valid template const parms.  */
-             default:
-               ;
-             }
-         /* else we get two different bindings, so deduction fails.  */
-         return 1;
+         int i = cp_tree_equal (targs[idx], arg);
+         if (i == 1)
+           return 0;
+         else if (i == 0)
+           return 1;
+         else
+           my_friendly_abort (42);
        }
-/*     else if (typeof arg != tparms[idx])
-       return 1;*/
 
       targs[idx] = copy_to_permanent (arg);
       return 0;