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
This commit is contained in:
Nathan Sidwell 2002-09-13 21:47:22 +00:00 committed by Nathan Sidwell
parent 32b4f6f42a
commit 712467a4c9
4 changed files with 34 additions and 1 deletions

View 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.

View 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:

View 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

View File

@ -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);
}