>I don't quite understand your answer. It seems that (a) is the important
>issue; if the programs are valid, they compiled before, and they worked
>before, then it seems there really is a regression, even if we can argue
>that we were "right by accident" in the past.
>
This is a clarification of code validity issue: using sample code from PR21235:
class KopeteAwayDialog { KopeteAwayDialog(); }; namespace Kopete { class Away { friend class KopeteAwayDialog; }; } using namespace Kopete; KopeteAwayDialog::KopeteAwayDialog(){}
Sure, this code compiles with 4.1 and 3.4 but doesn't compile with 4.0. Although the code is valid, I'd bet it doesn't work the way the
programmer of the above code (or other 99% who doesn't track
the standard closely) would expect.
In the above code, according to 4.0 and 4.1, there are actually
two 'KopeteAwayDialog' classes: 'Away::KopeteAwayDialog' and
'::KopeteAwayDialog'. Only the former is a friend of class 'Away'. The later, with class and constructor defined by programmer, still cannot
access any private/protected member of 'Away'.
Simple fix is changing the friend declaration to:
friend class ::KopeteAwayDialog;
which is what programmer intend and should work on all versions of GCC, new or old.
--Kriang