diff options
author | Mark Mitchell <mark@codesourcery.com> | 2005-03-09 18:35:48 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 2005-03-09 18:35:48 +0000 |
commit | 02bab9db99a4b27a1f486dfc299053d103032ce3 (patch) | |
tree | 40d12112b08c115bce316074dbf172623ecc0d23 /gcc/cp | |
parent | a35da91ff29d52b54f6238c6437dafd799abfd51 (diff) | |
download | gcc-02bab9db99a4b27a1f486dfc299053d103032ce3.zip gcc-02bab9db99a4b27a1f486dfc299053d103032ce3.tar.gz gcc-02bab9db99a4b27a1f486dfc299053d103032ce3.tar.bz2 |
re PR c++/20208 (No array-to-pointer decay happens for template functions)
PR c++/20208
* pt.c (tsubst_decl): Apply array-to-pointer and
function-to-pointer conversions to function arguments.
(regenerate_decl_from_template): Likewise.
PR c++/20208
* g++.dg/template/array13.C: New test.
From-SVN: r96197
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/cp/pt.c | 2 |
2 files changed, 9 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 7986946..0665b65 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,10 @@ +2005-03-09 Mark Mitchell <mark@codesourcery.com> + + PR c++/20208 + * pt.c (tsubst_decl): Apply array-to-pointer and + function-to-pointer conversions to function arguments. + (regenerate_decl_from_template): Likewise. + 2005-03-09 Paolo Carlini <pcarlini@suse.de> PR c++/16859 diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 320cd84..2ad20b34a 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -6515,6 +6515,7 @@ tsubst_decl (tree t, tree args, tsubst_flags_t complain) SET_DECL_TEMPLATE_PARM_P (r); type = tsubst (TREE_TYPE (t), args, complain, in_decl); + type = type_decays_to (type); TREE_TYPE (r) = type; cp_apply_type_quals_to_decl (cp_type_quals (type), r); @@ -11136,6 +11137,7 @@ regenerate_decl_from_template (tree decl, tree tmpl) DECL_NAME (decl_parm) = DECL_NAME (pattern_parm); parm_type = tsubst (TREE_TYPE (pattern_parm), args, tf_error, NULL_TREE); + parm_type = type_decays_to (parm_type); if (!same_type_p (TREE_TYPE (decl_parm), parm_type)) TREE_TYPE (decl_parm) = parm_type; decl_parm = TREE_CHAIN (decl_parm); |