I can't get my friends to work

David Alan Gilbert dg@cogency.co.uk
Thu Oct 30 09:48:00 GMT 1997


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:

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 -                               -
----------------------------------------------------------------------



More information about the Gcc-bugs mailing list