From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3528 invoked by alias); 13 Oct 2009 06:39:12 -0000 Received: (qmail 3340 invoked by uid 48); 13 Oct 2009 06:38:52 -0000 Date: Tue, 13 Oct 2009 06:39:00 -0000 Message-ID: <20091013063852.3339.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug c++/41690] Scoping is incorrect for inherited classes nested inside a templated class. In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "timothy dot renner at gmail dot com" 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: 2009-10/txt/msg01098.txt.bz2 ------- Comment #4 from timothy dot renner at gmail dot com 2009-10-13 06:38 ------- >Actually it is. > >The name of the parent class really is templ::A, which is a templated class. Sorry, my mistake, I mistyped that. Let me clarify. I didn't mean the parent class, I meant the containing class. I'm not sure what the technical name is for the class that houses a nested class. Classes A and B nested in class templ are definitely templated, but what about classes A and B nested in class notempl? What I am curious about is that the compiler does recognize inheritance in a templated class: If I added public constructors to both A and B: A() {} and B() : A() {} A() is accessibile by class B, and that code will compile, but the compiler does not recognize that d_data from A is accessible by B when templation is involved, but does recognize it when templation is not involved. I can see it being a more complicated case to parse correctly, but the current behavior seems inconsistent to me and like something the compiler should not throw an error on, so if there is a good reason why it should work the way it currently does, I'd really like to learn what it is. If not, this bug should be reopened and kept around at the very least as a "nice to have" feature since it's easily worked around, or just flat out marked as a won't fix. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41690