pt.c (tsubst, [...]): Fix getting complete args for a member template specialization.
* pt.c (tsubst, case FUNCTION_DECL): Fix getting complete args for a member template specialization. * tree.c (ovl_member): Use decls_match to compare functions. * decl.c (decls_match): Check the context of a function. From-SVN: r21248
This commit is contained in:
parent
f022f9bcfc
commit
c5a6fc4557
4 changed files with 19 additions and 5 deletions
|
@ -1,5 +1,11 @@
|
|||
1998-07-17 Jason Merrill <jason@yorick.cygnus.com>
|
||||
|
||||
* pt.c (tsubst, case FUNCTION_DECL): Fix getting complete args for
|
||||
a member template specialization.
|
||||
|
||||
* tree.c (ovl_member): Use decls_match to compare functions.
|
||||
* decl.c (decls_match): Check the context of a function.
|
||||
|
||||
* parse.y (primary): Use notype_unqualified_id instead of IDENTIFIER
|
||||
in Koenig lookup support rules.
|
||||
* semantics.c (finish_call_expr): Handle the new cases.
|
||||
|
|
|
@ -2464,6 +2464,11 @@ decls_match (newdecl, olddecl)
|
|||
tree p1 = TYPE_ARG_TYPES (f1);
|
||||
tree p2 = TYPE_ARG_TYPES (f2);
|
||||
|
||||
if (DECL_REAL_CONTEXT (newdecl) != DECL_REAL_CONTEXT (olddecl)
|
||||
&& ! (DECL_LANGUAGE (newdecl) == lang_c
|
||||
&& DECL_LANGUAGE (olddecl) == lang_c))
|
||||
return 0;
|
||||
|
||||
/* When we parse a static member function definition,
|
||||
we put together a FUNCTION_DECL which thinks its type
|
||||
is METHOD_TYPE. Change that to FUNCTION_TYPE, and
|
||||
|
|
11
gcc/cp/pt.c
11
gcc/cp/pt.c
|
@ -4642,7 +4642,10 @@ tsubst (t, args, in_decl)
|
|||
tmpl = DECL_TI_TEMPLATE (t);
|
||||
|
||||
/* Start by getting the innermost args. */
|
||||
argvec = tsubst (DECL_TI_ARGS (t), args, in_decl);
|
||||
if (DECL_TEMPLATE_SPECIALIZATION (tmpl))
|
||||
argvec = args;
|
||||
else
|
||||
argvec = tsubst (DECL_TI_ARGS (t), args, in_decl);
|
||||
|
||||
if (DECL_TEMPLATE_INFO (tmpl))
|
||||
argvec = complete_template_args (tmpl, argvec, 0);
|
||||
|
@ -5728,11 +5731,11 @@ instantiate_template (tmpl, targ_ptr)
|
|||
|
||||
my_friendly_assert (TREE_CODE (tmpl) == TEMPLATE_DECL, 283);
|
||||
|
||||
/* FIXME this won't work with member templates; we only have one level
|
||||
of args here. */
|
||||
/* Check to see if we already have this specialization. This does work
|
||||
for member template specializations; the list is set up from the
|
||||
tsubst TEMPLATE_DECL case when the containing class is instantiated. */
|
||||
if (DECL_FUNCTION_TEMPLATE_P (tmpl))
|
||||
{
|
||||
/* Check to see if we already have this specialization. */
|
||||
tree spec = retrieve_specialization (tmpl, targ_ptr);
|
||||
|
||||
if (spec != NULL_TREE)
|
||||
|
|
|
@ -1412,7 +1412,7 @@ ovl_member (fn, ovl)
|
|||
if (!ovl || TREE_CODE (ovl) != OVERLOAD)
|
||||
return 0;
|
||||
for (; ovl; ovl = OVL_CHAIN (ovl))
|
||||
if (OVL_FUNCTION (ovl) == fn)
|
||||
if (decls_match (OVL_FUNCTION (ovl), fn))
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue