This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/29615] Class can't be friends of itself?
- From: "jens-devel at gmx dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 15 Oct 2007 12:48:38 -0000
- Subject: [Bug c++/29615] Class can't be friends of itself?
- References: <bug-29615-13480@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #3 from jens-devel at gmx dot de 2007-10-15 12:48 -------
Subject: Class can't be friends of itself?
Hi,
I think gcc should be able to compile something like this.
There is no other way to make a member-variable accessible only from all
objects which are of the same type. Am I wrong?
<test.cpp>
class A
{
friend class A;
private:
int var_accessible_from_all_A_objects;
};
int main() { return 0; }
</test.cpp>
Greetings
Jens
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29615