pt.c (try_one_overload): Take orig_targs again.

* pt.c (try_one_overload): Take orig_targs again.  Only check for
	mismatches against them; we don't care what a previous call found.
	(resolve_overloaded_unification): Adjust.
	* search.c (lookup_field): Don't return anything for a non-type
	field from a dependent type.
	* decl.c (grokdeclarator): Resolve SCOPE_REFs of the current class
	in an array declarator.
	(start_decl): Push into the class before looking for the field.

From-SVN: r23605
This commit is contained in:
Jason Merrill 1998-11-11 03:42:37 +00:00 committed by Jason Merrill
parent a8ec10c912
commit e97e526319
4 changed files with 38 additions and 11 deletions

View File

@ -1,3 +1,15 @@
1998-11-11 Jason Merrill <jason@yorick.cygnus.com>
* pt.c (try_one_overload): Take orig_targs again. Only check for
mismatches against them; we don't care what a previous call found.
(resolve_overloaded_unification): Adjust.
* search.c (lookup_field): Don't return anything for a non-type
field from a dependent type.
* decl.c (grokdeclarator): Resolve SCOPE_REFs of the current class
in an array declarator.
(start_decl): Push into the class before looking for the field.
1998-11-08 Mark Mitchell <mark@markmitchell.com>
* method.c (build_overload_value): Handle REFERENCE_TYPE.

View File

@ -6658,6 +6658,8 @@ start_decl (declarator, declspecs, initialized, attributes, prefix_attributes)
if (context && TYPE_SIZE (complete_type (context)) != NULL_TREE)
{
pushclass (context, 2);
if (TREE_CODE (decl) == VAR_DECL)
{
tree field = lookup_field (context, DECL_NAME (decl), 0, 0);
@ -6699,8 +6701,6 @@ start_decl (declarator, declspecs, initialized, attributes, prefix_attributes)
if (DECL_EXTERNAL (decl) && ! DECL_TEMPLATE_SPECIALIZATION (decl))
cp_pedwarn ("declaration of `%#D' outside of class is not definition",
decl);
pushclass (context, 2);
}
#ifdef SET_DEFAULT_DECL_ATTRIBUTES
@ -9604,6 +9604,17 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
constant, but we don't know what the value is yet. */
if (processing_template_decl)
{
/* Resolve a qualified reference to an enumerator or
static const data member of ours. */
if (TREE_CODE (size) == SCOPE_REF
&& TREE_OPERAND (size, 0) == current_class_type)
{
tree t = lookup_field (current_class_type,
TREE_OPERAND (size, 1), 0, 0);
if (t)
size = t;
}
itype = make_node (INTEGER_TYPE);
TYPE_MIN_VALUE (itype) = size_zero_node;
TYPE_MAX_VALUE (itype) = build_min

View File

@ -80,7 +80,7 @@ static int unify PROTO((tree, tree, tree, tree, int, int*));
static int resolve_overloaded_unification PROTO((tree, tree, tree, tree,
unification_kind_t, int,
int*));
static int try_one_overload PROTO((tree, tree, tree, tree,
static int try_one_overload PROTO((tree, tree, tree, tree, tree,
unification_kind_t, int, int*));
static int unify PROTO((tree, tree, tree, tree, int, int*));
static void add_pending_template PROTO((tree));
@ -7031,7 +7031,7 @@ resolve_overloaded_unification (tparms, targs, parm, arg, strict,
if (subargs)
{
elem = tsubst (TREE_TYPE (fn), subargs, NULL_TREE);
good += try_one_overload (tparms, tempargs, parm, elem,
good += try_one_overload (tparms, targs, tempargs, parm, elem,
strict, sub_strict, explicit_mask);
}
}
@ -7039,7 +7039,7 @@ resolve_overloaded_unification (tparms, targs, parm, arg, strict,
else if (TREE_CODE (arg) == OVERLOAD)
{
for (; arg; arg = OVL_NEXT (arg))
good += try_one_overload (tparms, tempargs, parm,
good += try_one_overload (tparms, targs, tempargs, parm,
TREE_TYPE (OVL_CURRENT (arg)),
strict, sub_strict, explicit_mask);
}
@ -7073,9 +7073,9 @@ resolve_overloaded_unification (tparms, targs, parm, arg, strict,
Returns 1 on success. */
static int
try_one_overload (tparms, targs, parm, arg, strict,
try_one_overload (tparms, orig_targs, targs, parm, arg, strict,
sub_strict, explicit_mask)
tree tparms, targs, parm, arg;
tree tparms, orig_targs, targs, parm, arg;
unification_kind_t strict;
int sub_strict;
int* explicit_mask;
@ -7107,11 +7107,11 @@ try_one_overload (tparms, targs, parm, arg, strict,
return 0;
/* First make sure we didn't deduce anything that conflicts with
previously deduced/specified args. */
explicitly specified args. */
for (i = nargs; i--; )
{
tree elt = TREE_VEC_ELT (tempargs, i);
tree oldelt = TREE_VEC_ELT (targs, i);
tree oldelt = TREE_VEC_ELT (orig_targs, i);
if (elt == NULL_TREE)
continue;

View File

@ -1186,11 +1186,15 @@ lookup_field (xbasetype, name, protect, want_type)
template <class T> void S<T>::I::f() {}
will come through here to handle `S<T>::I'. */
if (rval && TREE_CODE (rval) == TYPE_DECL
&& processing_template_decl
if (rval && processing_template_decl
&& ! currently_open_class (BINFO_TYPE (rval_binfo))
&& uses_template_parms (type))
{
/* Don't return a non-type. Actually, we ought to return something
so lookup_name_real can give a warning. */
if (TREE_CODE (rval) != TYPE_DECL)
return NULL_TREE;
binfo = rval_binfo;
for (; ; binfo = BINFO_INHERITANCE_CHAIN (binfo))
if (BINFO_INHERITANCE_CHAIN (binfo) == NULL_TREE