This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/58054] New: 11.3 Friends, example from standard not compiled
- From: "dushistov at mail dot ru" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 02 Aug 2013 06:53:43 +0000
- Subject: [Bug c++/58054] New: 11.3 Friends, example from standard not compiled
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58054
Bug ID: 58054
Summary: 11.3 Friends, example from standard not compiled
Product: gcc
Version: 4.8.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: dushistov at mail dot ru
Here is example from standard (page 250-251),
class A {
class B { };
friend class X;
};
struct X : A::B { // OK: A::B accessible to friend
A::B mx; // OK: A::B accessible to member of friend
class Y {
A::B my; // OK: A::B accessible to nested member of friend
};
};
$ g++ -std=c++11 -Wall -c test_friend.cc
test_friend.cc:2:9: error: 'class A::B' is private
class B { };
^
test_friend.cc:6:15: error: within this context
struct X : A::B { // OK: A::B accessible to friend
^
I suppose that lines marked as OK in C++11 standard should
not emit any errors.