This is the mail archive of the gcc-bugs@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]

I can't get my friends to work (Resend with missing error message!)


Sorry - I missed the error message out last time:

Hi,
  I've got a linkedlist system done with a triplet of classes, lets
call them:

     ll_element
     ll
     ll_iter

ll keeps its list of ll_elements and I want all the functions in 'll'
to be friendly with ll_element so that ll methods  can get to the next
pointer in ll_element.

I used to (gcc2.7.2.x) do:

template<class content> ll_element {
  friend ll<content>;
  friend ll_iter<content>;  
}

and all was OK. But now if I do that I get:
LinkedList.h:44: `' is neither function nor method; cannot be declared friend

The line number is the line with the 'friend' statement on.

Is this a fix for an old over-liberalism or is it a new bug (the error
definitly looks dodgy)?
I can't seem to do it by tons of:

  friend ll<content>::add();

lines because it complanes that I'm declaring a friend before the 
class ll<content> is defined.

Suggestions?

Dave

P.S. Besides just being interested in egcs I'm trying this now
because GCC is failing with an internal error on a piece of my code.
-- 
----------------------------------------------------------------------
- David Alan Gilbert - WARNING! This is a beta release .signature    -
- Work:    dg @ cogency.co.uk        -    0161-428-9444              -
- Home:    gro.gilbert @ treblig.org -                               -
----------------------------------------------------------------------


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