Commit 41c5ee06 by Kriang Lerdsuwanakij Committed by Kriang Lerdsuwanakij

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
parent 83a279e4
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)
......
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
......
// { 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" }
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment