From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Artem Khodush" To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org Subject: Re: c++/3028: 3.0 Compiler complains about template that used to work under 2.95 Date: Fri, 01 Jun 2001 08:16:00 -0000 Message-id: <20010601151601.6832.qmail@sourceware.cygnus.com> X-SW-Source: 2001-06/msg00016.html List-Id: The following reply was made to PR c++/3028; it has been noted by GNATS. From: "Artem Khodush" To: Cc: , Subject: Re: c++/3028: 3.0 Compiler complains about template that used to work under 2.95 Date: Fri, 1 Jun 2001 18:58:15 +0400 > > template class IListBase > { > protected: > struct IListNode > { > IListNode *next; > int datum; > }; > > class IListNode *head; > class IListNode *tail; > > int find(int datum); > }; > > template int IListBase::find(int d) > { > IListNode *node; > for(node = head; node != 0; node = node->next) > { > if(node->datum == d) > { > return 1; > } > } > return 0; > } > > > >Fix: > A workaround seems to be to move the inner node class > out of the template list class and make it its own template > (but that breaks the protection). Well, the code works if after the IListNode is omitted. I believe gcc 3.0 is right, IListNode is indeed not a template.