pt.c (unify, ARRAY_TYPE): Element type can be more qualified.
authorNathan Sidwell <nathan@codesourcery.com>
Fri, 13 Sep 2002 21:47:22 +0000 (21:47 +0000)
committerNathan Sidwell <nathan@gcc.gnu.org>
Fri, 13 Sep 2002 21:47:22 +0000 (21:47 +0000)
cp:
* pt.c (unify, ARRAY_TYPE): Element type can be more qualified.
testsuite:
* g++.dg/template/deduce1.C: New test.

From-SVN: r57120

gcc/cp/ChangeLog
gcc/cp/pt.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/template/deduce1.C [new file with mode: 0644]

index 5048f985470e44c7379e3df6ec723d61eab04822..33729f4a7a9bc24e64b86cb7ce68c20fc1788527 100644 (file)
@@ -1,3 +1,7 @@
+2002-09-13  Nathan Sidwell  <nathan@codesourcery.com>
+
+       * pt.c (unify, ARRAY_TYPE): Element type can be more qualified.
+
 2002-09-13  Kazu Hirata  <kazu@cs.umass.edu>
 
        * decl.c: Fix comment formatting.
index d4fd2957afa69a3bec4d079da325e93c740fd86b..17e92f32246f4a9f88cf5963afbee06f33f20467 100644 (file)
@@ -8921,7 +8921,7 @@ unify (tparms, targs, parm, arg, strict)
                    TYPE_DOMAIN (arg), UNIFY_ALLOW_NONE) != 0)
        return 1;
       return unify (tparms, targs, TREE_TYPE (parm), TREE_TYPE (arg),
-                   UNIFY_ALLOW_NONE);
+                   strict & UNIFY_ALLOW_MORE_CV_QUAL);
 
     case REAL_TYPE:
     case COMPLEX_TYPE:
index b4ed1eb7ca50ec4f7d070091222a32ff80d5d0a4..5bd1e4032f94764861edd1ec84a2b05f8ec60e2f 100644 (file)
@@ -1,3 +1,7 @@
+2002-09-13  Nathan Sidwell  <nathan@codesourcery.com>
+
+       * g++.dg/template/deduce1.C: New test.
+
 2002-09-13  Kazu Hirata  <kazu@cs.umass.edu>
 
        * gcc.c-torture/execute/simd-1.c: Force all use of int to
diff --git a/gcc/testsuite/g++.dg/template/deduce1.C b/gcc/testsuite/g++.dg/template/deduce1.C
new file mode 100644 (file)
index 0000000..262c4fe
--- /dev/null
@@ -0,0 +1,25 @@
+// { dg-do run }
+
+// Copyright (C) 2002 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 13 Sep 2002 <nathan@codesourcery.com>
+
+template <typename T> int Foo (T const *)
+{
+  return 1;
+}
+template <typename T> int Foo (T const &)
+{
+  return 2;
+}
+template <typename T, __SIZE_TYPE__ I> int Foo (T const (&ref)[I])
+{
+  return 0;
+}
+
+int main ()
+{
+  static int array[4] = {};
+  
+  return Foo (array);
+}
+