Commit 5ee4cc26 by Nathan Sidwell Committed by Nathan Sidwell

decl.c (grokdeclarator): Do type access control on friend class.

cp:
	* decl.c (grokdeclarator): Do type access control on friend
	class.
testsuite:
	* g++.old-deja/g++.other/friend9.C: New test.

From-SVN: r37814
parent 8ce10512
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> 2000-11-27 Nathan Sidwell <nathan@codesourcery.com>
* decl.c (grokfndecl): Undo COMPONENT_REF damage caused by * decl.c (grokfndecl): Undo COMPONENT_REF damage caused by
......
...@@ -11305,12 +11305,15 @@ friend declaration requires class-key, i.e. `friend %#T'", ...@@ -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. */ /* Only try to do this stuff if we didn't already give up. */
if (type != integer_type_node) if (type != integer_type_node)
{ {
decl_type_access_control (TYPE_NAME (type));
/* A friendly class? */ /* A friendly class? */
if (current_class_type) if (current_class_type)
make_friend_class (current_class_type, TYPE_MAIN_VARIANT (type)); make_friend_class (current_class_type, TYPE_MAIN_VARIANT (type));
else else
cp_error ("trying to make class `%T' a friend of global scope", cp_error ("trying to make class `%T' a friend of global scope",
type); type);
type = void_type_node; type = void_type_node;
} }
} }
......
2000-11-28 Nathan Sidwell <nathan@codesourcery.com>
* g++.old-deja/g++.other/friend9.C: New test.
2000-11-28 Jakub Jelinek <jakub@redhat.com> 2000-11-28 Jakub Jelinek <jakub@redhat.com>
* gcc.dg/20001127-1.c: New test. * gcc.dg/20001127-1.c: New test.
2000-11-27 Nathan Sidwell <nathan@codesourcery.com> 2000-11-27 Nathan Sidwell <nathan@codesourcery.com>
* g++.old-deja/g++.other/friend46.C: New test. * g++.old-deja/g++.pt/friend46.C: New test.
2000-11-27 Nathan Sidwell <nathan@codesourcery.com> 2000-11-27 Nathan Sidwell <nathan@codesourcery.com>
......
// Build don't link:
// Copyright (C) 2000 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 24 Nov 2000 <nathan@codesourcery.com>
// Bug 853: We reported the wrong line no for a friend access violation
class F
{
class Internal; // ERROR - is private
};
class C
{
friend class F::Internal; // ERROR - in this context
public:
typedef enum { A, B } e;
C ();
~C();
void m();
};
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