aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorKriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>2003-07-17 15:47:40 +0000
committerKriang Lerdsuwanakij <lerdsuwa@gcc.gnu.org>2003-07-17 15:47:40 +0000
commit41c5ee0615beab8b7c047fc2c3e6d117c0240da7 (patch)
tree2f60f7136091812dabf73cdef8409d6786119b08 /gcc/cp
parent83a279e492cac61e9eda9ef0047c023d62a47318 (diff)
downloadgcc-41c5ee0615beab8b7c047fc2c3e6d117c0240da7.zip
gcc-41c5ee0615beab8b7c047fc2c3e6d117c0240da7.tar.gz
gcc-41c5ee0615beab8b7c047fc2c3e6d117c0240da7.tar.bz2
re PR c++/7809 (befriending inaccessible names)
PR c++/7809 * friend.c (add_friend): Check access for member functions and templates. * g++.dg/parse/access3.C: New test. From-SVN: r69513
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/friend.c3
2 files changed, 8 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 72bd508..82db5a4 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+2003-07-17 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ PR c++/7809
+ * g++.dg/parse/access3.C: New test.
+
2003-07-17 Gabriel Dos Reis <gdr@integrable-solutions.net>
PR c++/10668
diff --git a/gcc/cp/friend.c b/gcc/cp/friend.c
index e31a055..b71c5f2 100644
--- a/gcc/cp/friend.c
+++ b/gcc/cp/friend.c
@@ -170,6 +170,9 @@ add_friend (tree type, tree decl)
list = TREE_CHAIN (list);
}
+ if (DECL_CLASS_SCOPE_P (decl))
+ perform_or_defer_access_check (TYPE_BINFO (DECL_CONTEXT (decl)), decl);
+
maybe_add_class_template_decl_list (type, decl, /*friend_p=*/1);
DECL_FRIENDLIST (typedecl)