aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@codesourcery.com>2002-09-13 21:47:22 +0000
committerNathan Sidwell <nathan@gcc.gnu.org>2002-09-13 21:47:22 +0000
commit712467a4c95b97059c09de437fa8cbd046663f6a (patch)
tree5a445ad19242301c5ad05e9d614ae622c3bbd199
parent32b4f6f42ab798717813254ce9a2087f6573522c (diff)
downloadgcc-712467a4c95b97059c09de437fa8cbd046663f6a.zip
gcc-712467a4c95b97059c09de437fa8cbd046663f6a.tar.gz
gcc-712467a4c95b97059c09de437fa8cbd046663f6a.tar.bz2
pt.c (unify, ARRAY_TYPE): Element type can be more qualified.
cp: * pt.c (unify, ARRAY_TYPE): Element type can be more qualified. testsuite: * g++.dg/template/deduce1.C: New test. From-SVN: r57120
-rw-r--r--gcc/cp/ChangeLog4
-rw-r--r--gcc/cp/pt.c2
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/g++.dg/template/deduce1.C25
4 files changed, 34 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 5048f98..33729f4 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -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.
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index d4fd295..17e92f3 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -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:
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index b4ed1eb..5bd1e40 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -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
index 0000000..262c4fe
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/deduce1.C
@@ -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);
+}
+