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++/47346] New: access control for nested type is ignored in class template


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

           Summary: access control for nested type is ignored in class
                    template
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Keywords: accepts-invalid
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: redi@gcc.gnu.org


There are several bugs about failure to do access checking for template
parameters and in function templates (PR 40901, PR 41437, PR 45011, PR 45917)
but I don't think this is a dup of any of them

class C
{
  struct Private { };
};

template<typename T>
struct exploit1
{
    typedef C::Private type;
};

exploit1<int>::type x1;   // error

// similarly for base-specifier
template<typename T>
struct exploit2 : C::Private
{
};

exploit2<int> x2;   // error


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