This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/16413] New: 3.3 regression: operator() of private member accessible
- From: "tempa at enigmati dot ca" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 7 Jul 2004 18:36:29 -0000
- Subject: [Bug c++/16413] New: 3.3 regression: operator() of private member accessible
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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