Your original complaint was about an issue with templates, not with
friend functions. If -fpermissive solves the template issue as well
then I would guess it was a simple dependent name look-up issue in a
base class method called from a derived class method. gcc got more
strict about that a few years ago when moving to support two phase
look-up in conformity with the standard, but retained the old behaviour
for defective code with the -fpermissive flag.
If you had originally posted a more informative post with some code and
sample error messages instead of complaining about "getting hundreds of
undefined references in those templates" with the question "How can I
revert to the good old times?", and it was a name look-up issue, people
would have been able to help you and you would have been told to use
the -fpermissive flag to revert to the good old times.
The fact that you knew about this all along ("of course that works")
seems to prove the point that in your original posting you were not
asking a genuine question but just having a good rant.
But if I am wrong about that and you still want an answer about your
template problems (and being told "how can I revert to the good old
times" is not after all enough), you can solve the issue
without -fpermissive by disambiguating the dependent name look-up,
either with a type qualifier - so if B is the template base class and
f() is the method name, by calling B::f() explicitly in your derived
class method - or by using the this keyword by calling this->f(). If
the problem is with type names not identifier names, you might need more
liberal use of the 'typename' keyword.
If that doesn't work, the template problems stem from something else and
you are seeking genuine help, post something more informative.
Chris