+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.
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);
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
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
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));
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);
}
}
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);
}
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;
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;
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