This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/58054] New: 11.3 Friends, example from standard not compiled


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]