From 712467a4c95b97059c09de437fa8cbd046663f6a Mon Sep 17 00:00:00 2001 From: Nathan Sidwell Date: Fri, 13 Sep 2002 21:47:22 +0000 Subject: [PATCH] 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 --- gcc/cp/ChangeLog | 4 ++++ gcc/cp/pt.c | 2 +- gcc/testsuite/ChangeLog | 4 ++++ gcc/testsuite/g++.dg/template/deduce1.C | 25 +++++++++++++++++++++++++ 4 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/g++.dg/template/deduce1.C diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 5048f985470..33729f4a7a9 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,7 @@ +2002-09-13 Nathan Sidwell + + * pt.c (unify, ARRAY_TYPE): Element type can be more qualified. + 2002-09-13 Kazu Hirata * decl.c: Fix comment formatting. diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index d4fd2957afa..17e92f32246 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 b4ed1eb7ca5..5bd1e4032f9 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2002-09-13 Nathan Sidwell + + * g++.dg/template/deduce1.C: New test. + 2002-09-13 Kazu Hirata * 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 00000000000..262c4fe86e5 --- /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 + +template int Foo (T const *) +{ + return 1; +} +template int Foo (T const &) +{ + return 2; +} +template int Foo (T const (&ref)[I]) +{ + return 0; +} + +int main () +{ + static int array[4] = {}; + + return Foo (array); +} + -- 2.30.2