diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index d8adeecfda0..73b3b3ac190 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,7 @@ Tue Mar 3 01:38:17 1998 Jason Merrill + * pt.c (unify): Don't allow reduced cv-quals when strict. + * call.c, class.c, pt.c, cp-tree.h: Remove nsubsts parm from *type_unification* and unify. diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 3a3db96cce6..36f8aafa554 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -5290,6 +5290,13 @@ unify (tparms, targs, ntparms, parm, arg, strict) if (arg == parm) return 0; + /* We can't remove cv-quals when strict. */ + if (strict && TREE_CODE (arg) == TREE_CODE (parm) + && TREE_CODE_CLASS (TREE_CODE (arg)) == 't' + && (TYPE_READONLY (arg) < TYPE_READONLY (parm) + || TYPE_VOLATILE (arg) < TYPE_VOLATILE (parm))) + return 1; + switch (TREE_CODE (parm)) { case TYPENAME_TYPE: