This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: What does this error message means?


Alex Buell wrote:
> 
> On Sun, 18 Oct 1998, Nathan Sidwell wrote:
> 
> > It's a *warning* not an error -- the word `warning' should have given
> > you a clue :-)
> 
> Except in this case, it stops immediately after this message, and displays
> some really weird characters, as you can see from the following output.
> 
> gcc -c -O6 -m486 -I. -I/usr/include/g++  -Wall -finline-functions -funroll-all-loops -fguiding-decls -traditional -DSOUNDSUPPORT beebmem.cc
> In file included from dagXCL/Window.h:29,
>                  from dagXCL/TopLevelWindow.h:27,
>                  from beebwin.h:30,
>                  from main.h:24,
>                  from beebmem.cc:30:
> dagCL/AssocArray.h:48: warning: ANSI C++ forbids declaration `dagAssocArray' with no type
> dagCL/AssocArray.h:48: `G>' is neither function nor method; cannot be declared friend
Ah, these are, infact, two messages about the same line. (you only gave
the first in your original message -- we're not psychic!). The first is
just a warning. The second is the error message which aborted
compilation.

> This is the code as follows (the error occurs on the line where it defines
> friend dagAssocArray<Index,Content>)
> 
> template<class Index, class Content> class dagAssocArray_Element {
>   friend dagAssocArray<Index,Content>;
>   Index index;
>   Content* content;
>   dagAssocArray_Element<Index,Content>* next;
> 
>   dagAssocArray_Element(Index i, Content* c,
>     dagAssocArray_Element<Index,Content>* n) : index(i), content(c),
> next(n) {};
> }; /* dagAssocArray_Element */

I'm not an expert on friend template declarations, but they have been
upgraded to be closer to the standard, in the process some previously
accepted illegal code is now rejected (the NEWS file has some info on
this).

I suspect you really want (something like)
	friend class dagAssocArray<Index,Content>;

nathan
-- 
Dr Nathan Sidwell :: Computer Science Department :: Bristol University
      You can up the bandwidth, but you can't up the speed of light      
nathan@acm.org  http://www.cs.bris.ac.uk/~nathan/  nathan@cs.bris.ac.uk


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]