summaryrefslogtreecommitdiffstats
path: root/gcc/cp/friend.c
diff options
context:
space:
mode:
authormmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>1999-03-27 17:33:36 +0000
committermmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>1999-03-27 17:33:36 +0000
commite207930b71ca2e376647e0e2da390aa30a780a29 (patch)
tree60ca8cc353fd96a0c775f1b61e4833ed942c36b0 /gcc/cp/friend.c
parenta553c8ea8344e2ae3df2d332dcb002a81694afbc (diff)
downloadppe42-gcc-e207930b71ca2e376647e0e2da390aa30a780a29.tar.gz
ppe42-gcc-e207930b71ca2e376647e0e2da390aa30a780a29.zip
* cp-tree.h (add_friend): Declare.
(add_friends): Likewise. * friend.c (add_friend): Make it global. Don't add to DECL_BEFRIENDING_CLASSES if the befriending class is a template. (add_friends): Make it global. (make_friend_class): Don't add to DECL_BEFRIENDING_CLASSES if the befriending class is a template. * parse.y (component_decl_1): Fix typo in comment. * parse.c: Regenerated. * pt.c (instantiate_class_template): Use add_friend and add_friends rather that duplicating some of their functionality here. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@26020 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/friend.c')
-rw-r--r--gcc/cp/friend.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/gcc/cp/friend.c b/gcc/cp/friend.c
index 2a69acd8d84..285432f5ccd 100644
--- a/gcc/cp/friend.c
+++ b/gcc/cp/friend.c
@@ -27,9 +27,6 @@ Boston, MA 02111-1307, USA. */
#include "output.h"
#include "toplev.h"
-static void add_friend PROTO((tree, tree));
-static void add_friends PROTO((tree, tree, tree));
-
/* Friend data structures are described in cp-tree.h. */
/* Returns non-zero if SUPPLICANT is a friend of TYPE. */
@@ -140,7 +137,7 @@ is_friend (type, supplicant)
/* Add a new friend to the friends of the aggregate type TYPE.
DECL is the FUNCTION_DECL of the friend being added. */
-static void
+void
add_friend (type, decl)
tree type, decl;
{
@@ -176,15 +173,16 @@ add_friend (type, decl)
DECL_FRIENDLIST (typedecl)
= tree_cons (DECL_NAME (decl), build_tree_list (error_mark_node, decl),
DECL_FRIENDLIST (typedecl));
- DECL_BEFRIENDING_CLASSES (decl)
- = tree_cons (NULL_TREE, type,
- DECL_BEFRIENDING_CLASSES (decl));
+ if (!uses_template_parms (type))
+ DECL_BEFRIENDING_CLASSES (decl)
+ = tree_cons (NULL_TREE, type,
+ DECL_BEFRIENDING_CLASSES (decl));
}
/* Declare that every member function NAME in FRIEND_TYPE
(which may be NULL_TREE) is a friend of type TYPE. */
-static void
+void
add_friends (type, name, friend_type)
tree type, name, friend_type;
{
@@ -298,9 +296,10 @@ make_friend_class (type, friend_type)
= tree_cons (NULL_TREE, friend_type, CLASSTYPE_FRIEND_CLASSES (type));
if (is_template_friend)
friend_type = TREE_TYPE (friend_type);
- CLASSTYPE_BEFRIENDING_CLASSES (friend_type)
- = tree_cons (NULL_TREE, type,
- CLASSTYPE_BEFRIENDING_CLASSES (friend_type));
+ if (!uses_template_parms (type))
+ CLASSTYPE_BEFRIENDING_CLASSES (friend_type)
+ = tree_cons (NULL_TREE, type,
+ CLASSTYPE_BEFRIENDING_CLASSES (friend_type));
}
}
OpenPOWER on IntegriCloud