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 45775] (c++) New: Private templated classes/structs inside a class.


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45775

           Summary: Private templated classes/structs inside a class.
           Product: gcc
           Version: 4.4.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: liranuna@gmail.com


Created attachment 21874
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=21874
Failing code

Using GCC 4.4.3, and the attached source code, GCC does not error that the
access to A::B<T> is illegal.

According to the C++ spec:

    11.8 Nested classes [class.access.nest]

    1 A nested class is a member and as such has the same access rights as any
other member. The members of an enclosing class have no special access to
members of a nested class; the usual access rules (Clause 11) shall be obeyed.

Note that A::C is erroring correctly.

-- 
Configure bugmail: http://gcc.gnu.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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