aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@codesourcery.com>2001-02-14 09:50:06 +0000
committerNathan Sidwell <nathan@gcc.gnu.org>2001-02-14 09:50:06 +0000
commitd0ab76243b1d7c0c8fed61ccc9b6835216a90e5f (patch)
tree5f92ac1ee453e7b4856484080511b1a004a8b379 /gcc
parent7773899b5fef6b079b6c09b2d6cf5b8e309e3120 (diff)
downloadgcc-d0ab76243b1d7c0c8fed61ccc9b6835216a90e5f.zip
gcc-d0ab76243b1d7c0c8fed61ccc9b6835216a90e5f.tar.gz
gcc-d0ab76243b1d7c0c8fed61ccc9b6835216a90e5f.tar.bz2
pt.c (unify): Don't check cv quals of array types.
cp: * pt.c (unify): Don't check cv quals of array types. testsuite: * g++.old-deja/g++.pt/deduct6.C: New test. From-SVN: r39666
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog4
-rw-r--r--gcc/cp/pt.c4
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/deduct6.C24
4 files changed, 36 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 746b2f5..880e100 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,9 @@
2001-02-14 Nathan Sidwell <nathan@codesourcery.com>
+ * pt.c (unify): Don't check cv quals of array types.
+
+2001-02-14 Nathan Sidwell <nathan@codesourcery.com>
+
* tree.c (cp_build_qualified_type_real): Use CP_TYPE_QUALS to
check whether we already have the type.
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index bad8117..f82981bd 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -8552,6 +8552,10 @@ unify (tparms, targs, parm, arg, strict)
cv-qualification mismatches. */
if (TREE_CODE (arg) == TREE_CODE (parm)
&& TYPE_P (arg)
+ /* It is the elements of the array which hold the cv quals of an array
+ type, and the elements might be template type parms. We'll check
+ when we recurse. */
+ && TREE_CODE (arg) != ARRAY_TYPE
/* We check the cv-qualifiers when unifying with template type
parameters below. We want to allow ARG `const T' to unify with
PARM `T' for example, when computing which of two templates
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 60fd868..e483799 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,9 @@
2001-02-14 Nathan Sidwell <nathan@codesourcery.com>
+ * g++.old-deja/g++.pt/deduct6.C: New test.
+
+2001-02-14 Nathan Sidwell <nathan@codesourcery.com>
+
* g++.old-deja/g++.pt/deduct5.C: New test.
2001-02-14 Jakub Jelinek <jakub@redhat.com>
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/deduct6.C b/gcc/testsuite/g++.old-deja/g++.pt/deduct6.C
new file mode 100644
index 0000000..7fcef4e
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.pt/deduct6.C
@@ -0,0 +1,24 @@
+// Build don't link:
+// Copyright (C) 2000 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 13 Feb 2001 <nathan@codesourcery.com>
+
+// Bug 1962. We were not dealing with qualified array types properly.
+
+#include <stdio.h>
+
+template <typename T, unsigned I> int Baz (T (&obj)[I])
+{
+ printf ("%s\n", __PRETTY_FUNCTION__);
+ return 1;
+}
+
+int main ()
+{
+ static int const ca[1] = {1};
+ static int a[1] = {1};
+
+ Baz (ca);
+ Baz (a);
+
+ return 0;
+}