diff options
author | Jason Merrill <jason@redhat.com> | 2009-07-01 23:50:57 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2009-07-01 23:50:57 -0400 |
commit | 62e3e13ab38d0d8fec813ebaeafb567afd9129c5 (patch) | |
tree | bd5bfe552c39820b33c84ba5661b7c301fe20987 /gcc | |
parent | f2082f90284c7d4150febc7c0c0c2a5f43259854 (diff) | |
download | gcc-62e3e13ab38d0d8fec813ebaeafb567afd9129c5.zip gcc-62e3e13ab38d0d8fec813ebaeafb567afd9129c5.tar.gz gcc-62e3e13ab38d0d8fec813ebaeafb567afd9129c5.tar.bz2 |
pt.c (register_specialization): Use duplicate_decls to merge the argument with a previous specialization.
* pt.c (register_specialization): Use duplicate_decls to merge
the argument with a previous specialization.
(check_explicit_specialization): Call register_specialization to
merge the TEMPLATE_DECL with a previous version.
(determine_specialization): Return the args even if fn is a template.
From-SVN: r149165
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/cp/pt.c | 10 |
2 files changed, 15 insertions, 3 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 7aa9024..6e79df9 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,11 @@ +2009-07-01 Jason Merrill <jason@redhat.com> + + * pt.c (register_specialization): Use duplicate_decls to merge + the argument with a previous specialization. + (check_explicit_specialization): Call register_specialization to + merge the TEMPLATE_DECL with a previous version. + (determine_specialization): Return the args even if fn is a template. + 2009-07-01 Ian Lance Taylor <iant@google.com> * g++spec.c (lang_specific_driver): Bump num_args by 1. diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index b7c309d..125b80e 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -1312,6 +1312,8 @@ register_specialization (tree spec, tree tmpl, tree args, bool is_friend) return fn; } } + else if (fn) + return duplicate_decls (spec, fn, is_friend); /* A specialization must be declared in the same namespace as the template it is specializing. */ @@ -1701,12 +1703,13 @@ determine_specialization (tree template_id, if (candidates) { tree fn = TREE_VALUE (candidates); - /* DECL is a re-declaration of a template function. */ + *targs_out = copy_node (DECL_TI_ARGS (fn)); + /* DECL is a re-declaration or partial instantiation of a template + function. */ if (TREE_CODE (fn) == TEMPLATE_DECL) return fn; /* It was a specialization of an ordinary member function in a template class. */ - *targs_out = copy_node (DECL_TI_ARGS (fn)); return DECL_TI_TEMPLATE (fn); } @@ -2237,7 +2240,8 @@ check_explicit_specialization (tree declarator, parm = TREE_CHAIN (parm)) DECL_CONTEXT (parm) = result; } - return tmpl; + return register_specialization (tmpl, gen_tmpl, targs, + is_friend); } /* Set up the DECL_TEMPLATE_INFO for DECL. */ |