summaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authornathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>2000-11-28 10:06:16 +0000
committernathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>2000-11-28 10:06:16 +0000
commit10c31c473912ff0638add0f7fd2f6571b26b4a44 (patch)
treedfcd9beb9fd00cbc3d3b6e43ed880f60301ee1e6 /gcc/cp
parent593c66173b904dfd9c639e9ff81d9aa40b636b13 (diff)
downloadgcc-10c31c473912ff0638add0f7fd2f6571b26b4a44.tar.gz
cp:
* decl.c (grokdeclarator): Do type access control on friend class. testsuite: * g++.old-deja/g++.other/friend9.C: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@37814 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/decl.c3
2 files changed, 8 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 438f29a13dc..fa0940110aa 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+2000-11-28 Nathan Sidwell <nathan@codesourcery.com>
+
+ * decl.c (grokdeclarator): Do type access control on friend
+ class.
+
2000-11-27 Nathan Sidwell <nathan@codesourcery.com>
* decl.c (grokfndecl): Undo COMPONENT_REF damage caused by
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 3ca4ff63084..da74687aa1a 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -11305,12 +11305,15 @@ friend declaration requires class-key, i.e. `friend %#T'",
/* Only try to do this stuff if we didn't already give up. */
if (type != integer_type_node)
{
+ decl_type_access_control (TYPE_NAME (type));
+
/* A friendly class? */
if (current_class_type)
make_friend_class (current_class_type, TYPE_MAIN_VARIANT (type));
else
cp_error ("trying to make class `%T' a friend of global scope",
type);
+
type = void_type_node;
}
}