public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/16413] New: 3.3 regression: operator() of private member accessible
@ 2004-07-07 18:36 tempa at enigmati dot ca
  2004-07-07 19:02 ` [Bug c++/16413] [3.3 regression] " bangerth at dealii dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: tempa at enigmati dot ca @ 2004-07-07 18:36 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2005-04-30 13:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-07-07 18:36 [Bug c++/16413] New: 3.3 regression: operator() of private member accessible tempa at enigmati dot ca
2004-07-07 19:02 ` [Bug c++/16413] [3.3 regression] " bangerth at dealii dot org
2004-09-28 13:38 ` gdr at gcc dot gnu dot org
2004-12-28  2:18 ` pinskia at gcc dot gnu dot org
2005-04-30 13:49 ` gdr at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).