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++/16413] New: 3.3 regression: operator() of private member accessible


The following simple code snippet is correctly rejected by versions 2.95 and
3.2, but is accepted by 3.3:


class A
{
public:
    int operator()(int i) const { return 0; }
};

class B
{
private:
    A a;
};

int main()
{
        return B().a(0);
}



This happens with both const and non-const operator(), but doesn't seem to
happen with other operators. I tried += and operator[], which both correctly
generated errors.

-- 
           Summary: 3.3 regression: operator() of private member accessible
           Product: gcc
           Version: 3.3.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: tempa at enigmati dot ca
                CC: gcc-bugs at gcc dot gnu dot org


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


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