From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16621 invoked by alias); 21 Mar 2005 15:30:04 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 16384 invoked by uid 48); 21 Mar 2005 15:29:47 -0000 Date: Mon, 21 Mar 2005 15:30:00 -0000 From: "mah at systematic dot dk" To: gcc-bugs@gcc.gnu.org Message-ID: <20050321152928.20578.mah@systematic.dk> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug c++/20578] New: Problem with templates X-Bugzilla-Reason: CC X-SW-Source: 2005-03/txt/msg02522.txt.bz2 List-Id: The following C++ code does not compile, which I believe it should (It compiles on gcc 1.1.1 and Microsoft's VS.NET): --------Code start-------- template class A { protected: int a; }; template class B: public A { public: void f() { a = 5; } }; --------Code end-------- I get the following error: test.cpp: In member function `void B::f()': test.cpp:10: error: `a' undeclared (first use this function) test.cpp:10: error: (Each undeclared identifier is reported only once for each function it appears in.) asterix:components/mde> /pack/gcc/3.4.3/bin/g++ test.cpptest.cpp: In member function `void B::f()': test.cpp:10: error: `a' undeclared (first use this function) test.cpp:10: error: (Each undeclared identifier is reported only once for each function it appears in.) -- Summary: Problem with templates Product: gcc Version: 3.4.3 Status: UNCONFIRMED Severity: normal Priority: P2 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: mah at systematic dot dk CC: gcc-bugs at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20578