From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23916 invoked by alias); 29 Oct 2002 15:39:18 -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 23875 invoked by uid 61); 29 Oct 2002 15:39:16 -0000 Date: Tue, 29 Oct 2002 07:39:00 -0000 Message-ID: <20021029153916.23874.qmail@sources.redhat.com> To: dv@vollmann.ch, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, nobody@gcc.gnu.org From: bangerth@dealii.org Reply-To: bangerth@dealii.org, dv@vollmann.ch, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, nobody@gcc.gnu.org, gcc-gnats@gcc.gnu.org Subject: Re: c++/8389: [mainline regression] Access to members of base class & templates X-SW-Source: 2002-10/txt/msg01207.txt.bz2 List-Id: Old Synopsis: Cannot access protected member in base class New Synopsis: [mainline regression] Access to members of base class & templates State-Changed-From-To: open->analyzed State-Changed-By: bangerth State-Changed-When: Tue Oct 29 07:39:14 2002 State-Changed-Why: Confirmed. It works in 3.2.1pre, though. The shortest example I can come up with is this: ---------------------------------- template class Base { protected: typedef int Type; }; template struct Derived : public Base { typedef typename Base::Type Type; template void f(Type = Type()) {}; }; template void Derived::f (Type); ----------------------------------- Making one of the templates a non-template makes the bug go away. What is also surprising is the three-fold output gcc gives: -------------------------------------- tmp/g> /home/bangerth/bin/gcc-3.3-pre/bin/c++ -ansi -pedantic -W -Wall -c x.cc x.cc:4: error: `typedef int Base::Type' is protected x.cc:12: error: within this context x.cc:4: error: `typedef int Base::Type' is protected x.cc:12: error: within this context x.cc:4: error: `typedef int Base::Type' is protected x.cc:15: error: within this context -------------------------------------- http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8389