* init.c (build_offset_ref): Don't call mark_used on an OVERLOAD.
* decl.c (select_decl): Extract a lone function from an OVERLOAD.
(lookup_namespace_name): Likewise.
* typeck.c (build_unary_op): Not here anymore.
* decl2.c (do_class_using_decl): Make sure we get an identifier.
* class.c (handle_using_decl): Ignore TYPE_DECLs.
From-SVN: r21219
1998-07-16 Jason Merrill <jason@yorick.cygnus.com>
+ * init.c (build_offset_ref): Don't call mark_used on an OVERLOAD.
+ * decl.c (select_decl): Extract a lone function from an OVERLOAD.
+ (lookup_namespace_name): Likewise.
+ * typeck.c (build_unary_op): Not here anymore.
+
+ * decl2.c (do_class_using_decl): Make sure we get an identifier.
+ * class.c (handle_using_decl): Ignore TYPE_DECLs.
+
* decl.c (qualify_lookup): New fn.
(lookup_name_real): Use it.
OVL_CURRENT (TREE_VEC_ELT (method_vec, i)));
return;
}
+
+ if (! DECL_LANG_SPECIFIC (fdecl))
+ /* We don't currently handle DECL_ACCESS for TYPE_DECLs; just return. */
+ return;
for (tmp = fields; tmp; tmp = TREE_CHAIN (tmp))
if (DECL_NAME (tmp) == name)
return error_mark_node;
if (BINDING_VALUE (val))
- return BINDING_VALUE (val);
+ {
+ val = BINDING_VALUE (val);
+
+ /* If we have a single function from a using decl, pull it out. */
+ if (TREE_CODE (val) == OVERLOAD && ! really_overloaded_fn (val))
+ val = OVL_FUNCTION (val);
+ return val;
+ }
+
cp_error ("`%D' undeclared in namespace `%D'", name, namespace);
return error_mark_node;
}
else if (val && LOOKUP_TYPES_ONLY (flags) && TREE_CODE (val) != TYPE_DECL
&& (!looking_for_template || TREE_CODE (val) != TEMPLATE_DECL))
val = NULL_TREE;
+
+ /* If we have a single function from a using decl, pull it out. */
+ if (val && TREE_CODE (val) == OVERLOAD && ! really_overloaded_fn (val))
+ val = OVL_FUNCTION (val);
+
return val;
}
type = NULL_TREE;
if (!BINDING_TYPE (old))
BINDING_TYPE (old) = type;
- else if(type && BINDING_TYPE (old) != type)
+ else if (type && BINDING_TYPE (old) != type)
{
if (flags & LOOKUP_COMPLAIN)
{
cp_error ("using-declaration for destructor");
return NULL_TREE;
}
+ if (TREE_CODE (name) == TYPE_DECL)
+ name = DECL_NAME (name);
+
+ my_friendly_assert (TREE_CODE (name) == IDENTIFIER_NODE, 980716);
value = build_lang_field_decl (USING_DECL, name, void_type_node);
DECL_INITIAL (value) = TREE_OPERAND (decl, 0);
if (TREE_CODE (type) == NAMESPACE_DECL)
{
t = lookup_namespace_name (type, name);
- mark_used (t);
- return convert_from_reference (t);
+ if (! type_unknown_p (t))
+ {
+ mark_used (t);
+ t = convert_from_reference (t);
+ }
+ return t;
}
if (type == NULL_TREE || ! is_aggr_type (type, 1))
return build1 (ADDR_EXPR, unknown_type_node, arg);
}
- /* If we have a single function from a using decl, pull it out. */
- if (TREE_CODE (arg) == OVERLOAD
- && ! really_overloaded_fn (arg))
- {
- arg = OVL_FUNCTION (arg);
- argtype = TREE_TYPE (arg);
- }
-
if (TREE_CODE (arg) == OVERLOAD
|| (TREE_CODE (arg) == OFFSET_REF
&& TREE_CODE (TREE_OPERAND (arg, 1)) == TEMPLATE_ID_EXPR))