From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12940 invoked by alias); 11 Aug 2011 18:54:41 -0000 Received: (qmail 12929 invoked by uid 22791); 11 Aug 2011 18:54:41 -0000 X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 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; Thu, 11 Aug 2011 18:54:27 +0000 From: "dodji at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/47346] access control for nested type is ignored in class template Date: Thu, 11 Aug 2011 18:54:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Keywords: accepts-invalid X-Bugzilla-Severity: normal X-Bugzilla-Who: dodji at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: dodji at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: 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 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: 2011-08/txt/msg01119.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47346 --- Comment #3 from Dodji Seketeli 2011-08-11 18:52:54 UTC --- Created attachment 24985 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24985 Work in progress patch I am currently testing this patch. The problem I see is twofold. First, the infrastructure I added a while back to do access checking of references to types, at template instantiation time, was limited to typedefs. This bug seems to suggest that the access checking should be done for references to all types. Not just typedefs. Second, add_typedef_to_current_template_for_access_check assumes that a "current template" is present. When we are parsing the class header (for e.g the base clause) or the template parameter list, the "current template" is not present yet. In that case, a possible solution is the stash away, for some short while, the types access that is to be checked, until the current template becomes available. This is the approach taken by this patch.