From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26636 invoked by alias); 24 Sep 2010 21:54:04 -0000 Received: (qmail 26627 invoked by uid 22791); 24 Sep 2010 21:54:03 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,MISSING_MID X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 24 Sep 2010 21:53:58 +0000 From: "MichieldeB at aim dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/45770] global access allowance exceeds that of derived class X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: MichieldeB at aim dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Status Resolution In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Fri, 24 Sep 2010 21:58:00 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2010-09/txt/msg02745.txt.bz2 Message-ID: <20100924215800.uLwUslSR-MM2tRqrnGoThTaqZ6GnHGQWAByv74wwmLE@z> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45770 MichieldeB at aim dot com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |UNCONFIRMED Resolution|INVALID | --- Comment #2 from MichieldeB at aim dot com 2010-09-24 21:53:56 UTC --- // If the access of locals should be inherited, then the following is a bug. // 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 allow local variables A below { 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 have local variables ::A // but not A }; template class D : private T { D(int i) : T(i) { U u; } }; template class D; // local A gets global access rights 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.