From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26163 invoked by alias); 29 Oct 2002 02:06:32 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 26105 invoked by uid 71); 29 Oct 2002 02:06:30 -0000 Resent-Date: 29 Oct 2002 02:06:30 -0000 Resent-Message-ID: <20021029020630.26104.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, dv@vollmann.ch Received: (qmail 15319 invoked from network); 29 Oct 2002 02:02:56 -0000 Received: from unknown (HELO mustang.centralnet.ch) (193.135.146.12) by sources.redhat.com with SMTP; 29 Oct 2002 02:02:56 -0000 Received: from vollmann.ch (luz170.centralnet.ch [193.135.147.170]) by mustang.centralnet.ch (8.9.3/8.9.3) with ESMTP id EAA4679040 for ; Tue, 29 Oct 2002 04:02:53 +0200 (MES) Received: (from dv@localhost) by vollmann.ch (8.9.3/8.9.3) id DAA09647; Tue, 29 Oct 2002 03:01:10 +0100 Message-Id: <200210290201.DAA09647@vollmann.ch> Date: Mon, 28 Oct 2002 18:06:00 -0000 From: dv@vollmann.ch To: gcc-gnats@gcc.gnu.org Cc: dv@vollmann.ch X-Send-Pr-Version: 3.113 Subject: c++/8389: Cannot access protected member in base class X-SW-Source: 2002-10/txt/msg01197.txt.bz2 List-Id: >Number: 8389 >Category: c++ >Synopsis: Cannot access protected member in base class >Confidential: no >Severity: critical >Priority: medium >Responsible: unassigned >State: open >Class: rejects-legal >Submitter-Id: net >Arrival-Date: Mon Oct 28 18:06:29 PST 2002 >Closed-Date: >Last-Modified: >Originator: Detlef Vollmann >Release: 3.3 20021027 (experimental) >Organization: vollmann engineering gmbh >Environment: System: Linux dwarf 2.4.3-XFS #7 Mon Aug 6 18:43:20 CEST 2001 i686 unknown Architecture: i686 host: i686-pc-linux-gnu build: i686-pc-linux-gnu target: i686-pc-linux-gnu configured with: /pdsrc/gcc/cvs/gcc/configure --program-suffix=-test --prefix=/local/gcc-test --enable-shared --enable-threads=posix --enable-version-specific-runtime-libs --enable-languages=c,c++ >Description: For the attached program, g++ gives the error message: test.cc: In member function `Derived Derived::f() const [with T = char]': test.cc:30: instantiated from here test.cc:6: error: `typedef int Base::Type' is protected test.cc:23: error: within this context >How-To-Repeat: just compile attached source (g++ -c test.cc) >Fix: //test.cc: template class Base { protected: typedef int Type; }; template class Derived : public Base { public: typedef Base BaseT; typedef typename BaseT::Type Type; template Derived(Arg a, const Type& t = Type()) { } Derived f() const { return Derived(i); } int i; }; template class Derived; >Release-Note: >Audit-Trail: >Unformatted: