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
This commit is contained in:
parent
83a279e492
commit
41c5ee0615
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -1,3 +1,9 @@
|
|||
2003-07-17 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
|
||||
|
||||
PR c++/7809
|
||||
* friend.c (add_friend): Check access for member functions
|
||||
and templates.
|
||||
|
||||
2003-06-17 Andrew Pinski <pinskia@physics.uc.edu>
|
||||
|
||||
PR c++/11384
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
// { dg-do compile }
|
||||
|
||||
// Origin: <bagnara@cs.unipr.it>
|
||||
|
||||
// PR c++/7809: Befriending inaccessible name.
|
||||
|
||||
class A {
|
||||
private:
|
||||
void f(); // { dg-error "private" }
|
||||
};
|
||||
|
||||
class B {
|
||||
friend void A::f(); // { dg-error "context" }
|
||||
};
|
Loading…
Reference in New Issue