Commit 436f8a4c by Mark Mitchell Committed by Mark Mitchell

re PR c++/8700 (unhelpful error message for binding temp to reference)

	PR c++/8700
	* call.c (convert_class_to_reference): Adjust usage of
	splice_viable.
	(any_viable): Remove.
	(splice_viable): Combine with any_viable.
	(print_z_candidates): Avoid printing duplicates.
	(build_user_type_conversion_1): Adjust usage of splice_viable.
	(build_new_function_call): Likewise.
	(build_operator_new_call): Likewise.
	(build_object_call): Likewise.
	(build_conditional_expr): Likewise.
	(build_new_op): Likewise.
	(build_new_method_call): Likewise.
	(joust): Remove spurious comment.
	* cp-tree.h (DECL_FRIENDLIST): Correct documentation.
	* decl2.c (arg_assoc_class): Simplify.
	* friend.c (add_friend): Likewise.

From-SVN: r64173
parent 1be4def3
2003-03-11 Mark Mitchell <mark@codesourcery.com>
PR c++/8700
* call.c (convert_class_to_reference): Adjust usage of
splice_viable.
(any_viable): Remove.
(splice_viable): Combine with any_viable.
(print_z_candidates): Avoid printing duplicates.
(build_user_type_conversion_1): Adjust usage of splice_viable.
(build_new_function_call): Likewise.
(build_operator_new_call): Likewise.
(build_object_call): Likewise.
(build_conditional_expr): Likewise.
(build_new_op): Likewise.
(build_new_method_call): Likewise.
(joust): Remove spurious comment.
* cp-tree.h (DECL_FRIENDLIST): Correct documentation.
* decl2.c (arg_assoc_class): Simplify.
* friend.c (add_friend): Likewise.
2003-03-11 Jason Merrill <jason@redhat.com>
PR c++/8660
......
......@@ -2657,14 +2657,8 @@ struct lang_decl GTY(())
/* The format of each node in the DECL_FRIENDLIST is as follows:
The TREE_PURPOSE will be the name of a function, i.e., an
IDENTIFIER_NODE. The TREE_VALUE will be itself a TREE_LIST, the
list of functions with that name which are friends. The
TREE_PURPOSE of each node in this sublist will be error_mark_node,
if the function was declared a friend individually, in which case
the TREE_VALUE will be the function_decl. If, however, all
functions with a given name in a class were declared to be friends,
the TREE_PUROSE will be the class type, and the TREE_VALUE will be
NULL_TREE. */
IDENTIFIER_NODE. The TREE_VALUE will be itself a TREE_LIST, whose
TREE_VALUEs are friends with the given name. */
#define DECL_FRIENDLIST(NODE) (DECL_INITIAL (NODE))
#define FRIEND_NAME(LIST) (TREE_PURPOSE (LIST))
#define FRIEND_DECLS(LIST) (TREE_VALUE (LIST))
......
......@@ -3936,13 +3936,12 @@ arg_assoc_class (struct arg_lookup *k, tree type)
/* Process friends. */
for (list = DECL_FRIENDLIST (TYPE_MAIN_DECL (type)); list;
list = TREE_CHAIN (list))
if (k->name == TREE_PURPOSE (list))
for (friends = TREE_VALUE (list); friends;
if (k->name == FRIEND_NAME (list))
for (friends = FRIEND_DECLS (list); friends;
friends = TREE_CHAIN (friends))
/* Only interested in global functions with potentially hidden
(i.e. unqualified) declarations. */
if (TREE_PURPOSE (friends) == error_mark_node && TREE_VALUE (friends)
&& decl_namespace (TREE_VALUE (friends)) == context)
if (decl_namespace (TREE_VALUE (friends)) == context)
if (add_function (k, TREE_VALUE (friends)))
return true;
......
......@@ -165,7 +165,7 @@ add_friend (type, decl)
maybe_add_class_template_decl_list (type, decl, /*friend_p=*/1);
TREE_VALUE (list) = tree_cons (error_mark_node, decl,
TREE_VALUE (list) = tree_cons (NULL_TREE, decl,
TREE_VALUE (list));
return;
}
......@@ -175,7 +175,7 @@ add_friend (type, decl)
maybe_add_class_template_decl_list (type, decl, /*friend_p=*/1);
DECL_FRIENDLIST (typedecl)
= tree_cons (DECL_NAME (decl), build_tree_list (error_mark_node, decl),
= tree_cons (DECL_NAME (decl), build_tree_list (NULL_TREE, decl),
DECL_FRIENDLIST (typedecl));
if (!uses_template_parms (type))
DECL_BEFRIENDING_CLASSES (decl)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment