public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug 45770] (c++) New: global access allowance exceeds that of derived class
@ 2010-09-23 23:11 MichieldeB at aim dot com
  2010-09-23 23:16 ` [Bug 45770] (c++) " pinskia at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: MichieldeB at aim dot com @ 2010-09-23 23:11 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: global access allowance exceeds that of derived class
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: MichieldeB@aim.com


// g++ (Ubuntu 4.4.3-4ubuntu5) 4.4.3
// Copyright (C) 2009 Free Software Foundation, Inc.
// This is free software; see the source for copying conditions.  There is NO
// warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

class A
{

friend class B;

public:
  A(int i) { a = i; }

private:
  A() { a = 0; }
  int a;

};

class B : private A // making protected will eliminate the below problem
{

public:
  B(int i) : A () { a = i >> 1; b = i & 1; }

private:
  bool b;

};

class C : public B
{

public:
  C() : B(4) { A foo(3); } // functions of B may not have local variables A

};             

main () { A bar(3); } // main may have local variables A

-- 
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.


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

end of thread, other threads:[~2010-09-26 19:36 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-23 23:11 [Bug 45770] (c++) New: global access allowance exceeds that of derived class MichieldeB at aim dot com
2010-09-23 23:16 ` [Bug 45770] (c++) " pinskia at gcc dot gnu.org
2010-09-24 21:58 ` [Bug c++/45770] " MichieldeB at aim dot com
2010-09-24 21:58 ` pinskia at gcc dot gnu.org
2010-09-26 22:31 ` MichieldeB at aim dot com
2010-09-26 22:40 ` paolo.carlini at oracle dot com
2010-09-27  7:18 ` redi at gcc dot gnu.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).