From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1913 invoked by alias); 11 May 2007 22:03:23 -0000 Received: (qmail 1904 invoked by uid 22791); 11 May 2007 22:03:23 -0000 X-Spam-Check-By: sourceware.org Received: from rrcs-agw-01.hrndva.rr.com (HELO rrcs-agw-01.hrndva.rr.com) (24.28.200.151) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 11 May 2007 22:03:19 +0000 Received: from 65.104.115.160.ptr.us.xo.net (HELO SynCirakk) ([65.104.115.160]) by rrcs-agw-01.hrndva.rr.com with ESMTP; 11 May 2007 17:59:35 -0400 Message-Id: <5p5klh$h9uto@rrcs-agw-01.hrndva.rr.com> From: "Karl Kobata" To: "'Ian Lance Taylor'" Cc: Subject: RE: compile error on template using gcc 3.4.4 that worked for gcc 3.3.x Date: Fri, 11 May 2007 22:03:00 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Office Outlook, Build 11.0.5510 In-Reply-To: Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2007-05/txt/msg00114.txt.bz2 Ian, You are correct. I added "this->". It corrected the errors I was getting. Thanks very much. karl -----Original Message----- From: Ian Lance Taylor [mailto:iant@google.com]=20 Sent: Wednesday, May 09, 2007 4:59 PM To: Karl Kobata Cc: gcc-help@gcc.gnu.org Subject: Re: compile error on template using gcc 3.4.4 that worked for gcc 3.3.x "Karl Kobata" writes: > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D source that is erroring =3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > 36 template class OutputBuffer : public Buffer { > 37 public: > 38 =A0=A0=A0virtual int Flush() =3D 0; > 39=A0 =A0=A0virtual int Put(const T& t) { *pt++ =3D t; return pt >=3D end= ? Flush() : > 0; } > 40 =A0=A0=A0OutputBuffer(unsigned int sz):Buffer(sz) { pt =3D base; } > 41 =A0=A0=A0OutputBuffer(T* b, unsigned int sz):Buffer(b, sz) { pt =3D= base; } > 42 =A0=A0=A0OutputBuffer() { pt =3D base; } > 43 =A0=A0=A0~OutputBuffer() {} > 44 }; >=20 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D error messages using gcc 3.4.4 =3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > /home/AppsTest/MGen/MgenLibrary/aeg/include/generic/buffer.h:39: error: `pt' > undeclared (first use this function) I don't see any declaration of 'pt' in the above code snippet. If 'pt' is declared in the base class, then you need to say "this->pt". To see why, search the net for "two-phase lookup." gcc 3.4 implemented a new C++ parser which is much more standards compliant. Ian