From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10227 invoked by alias); 29 Apr 2004 06:23:28 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 10217 invoked from network); 29 Apr 2004 06:23:26 -0000 Received: from unknown (HELO mtagate3.de.ibm.com) (195.212.29.152) by sources.redhat.com with SMTP; 29 Apr 2004 06:23:26 -0000 Received: from d12nrmr1507.megacenter.de.ibm.com (d12nrmr1507.megacenter.de.ibm.com [9.149.167.1]) by mtagate3.de.ibm.com (8.12.10/8.12.10) with ESMTP id i3T6NPn5094038; Thu, 29 Apr 2004 06:23:25 GMT Received: from d12ml102.megacenter.de.ibm.com (d12av02.megacenter.de.ibm.com [9.149.165.228]) by d12nrmr1507.megacenter.de.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i3T6NOLr095590; Thu, 29 Apr 2004 08:23:25 +0200 In-Reply-To: <20040429.081229.846948283.rene@rocklinux-consulting.de> To: Rene Rebe Cc: gcc@gcc.gnu.org, valentin@rocklinux-consulting.de MIME-Version: 1.0 Subject: Re: GCC 3.4.0 and template type resolution bug (no) From: Michael Veksler Message-ID: Date: Thu, 29 Apr 2004 08:04:00 -0000 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: quoted-printable X-SW-Source: 2004-04/txt/msg01361.txt.bz2 gcc-3.4 is correct (gcc-3.2 was buggy). Please read gcc-3.4 release notes. You should use this->m_info, otherwise the compiler will look for m_info=20 outside your classes, Rene Rebe Sent by: gcc-owner@gcc.gnu.org 29/04/2004 09:12 =20 To: gcc@gcc.gnu.org cc: valentin@rocklinux-consulting.de Subject: GCC 3.4.0 and template type resolution bug Hi, compiling one of our C++ projects I found a quite strange behaviour (=3D=3Dbug?) of gcc-3.4.0. The 3.4.0 version is not able to deduce m_info in the base template class's when the inherited class is a template, too. Although it does work with normal classes. (Of course the code does compile with earlier version of GCC - such as 3.2.3.) template class Basic { protected: INFO* m_info; }; template class Std : public Basic { public: bool testMe () { return m_info !=3D 0; } }; class Normal : public Basic { public: bool testMe () { return m_info !=3D 0; } }; int main () { return 0; } The error is: gcc34-template.cc: In member function `bool Std::testMe()': gcc34-template.cc:15: error: `m_info' undeclared (first use this function) gcc34-template.cc:15: error: (Each undeclared identifier is reported only=20 once for each function it appears in.) Sincerely yours, Ren=E9 Rebe - ROCK Linux stable release maintainer --=20 Ren=E9 Rebe - Europe/Germany/Berlin rene@rocklinux.org rene@rocklinux-consulting.de http://www.rocklinux.org http://www.rocklinux-consulting.de