summaryrefslogtreecommitdiff
path: root/gcc/cp/friend.c
diff options
context:
space:
mode:
authormmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>2004-05-31 22:48:30 +0000
committermmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>2004-05-31 22:48:30 +0000
commit7fede5dc0e7d330201ef9aecc2313847de8ad127 (patch)
tree8bf69c904b4e1c090f4fed19487a0ae1d79b5db4 /gcc/cp/friend.c
parentc6f905fcce8af6ffd34acbd59b33d9dfa7432bc1 (diff)
downloadgcc-7fede5dc0e7d330201ef9aecc2313847de8ad127.tar.gz
PR c++/15701
* friend.c (add_friend): Do not try to perform access checks for functions from dependent classes. PR c++/15701 * g++.dg/template/friend29.C: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@82516 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/friend.c')
-rw-r--r--gcc/cp/friend.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/cp/friend.c b/gcc/cp/friend.c
index e55adaa8bc0..f815b99f0b9 100644
--- a/gcc/cp/friend.c
+++ b/gcc/cp/friend.c
@@ -164,7 +164,11 @@ add_friend (tree type, tree decl, bool complain)
}
if (DECL_CLASS_SCOPE_P (decl))
- perform_or_defer_access_check (TYPE_BINFO (DECL_CONTEXT (decl)), decl);
+ {
+ tree class_binfo = TYPE_BINFO (DECL_CONTEXT (decl));
+ if (!uses_template_parms (BINFO_TYPE (class_binfo)))
+ perform_or_defer_access_check (class_binfo, decl);
+ }
maybe_add_class_template_decl_list (type, decl, /*friend_p=*/1);