The below doesn't compile with 4.0: class KopeteAwayDialog { KopeteAwayDialog(); }; namespace Kopete { class Away { friend class KopeteAwayDialog; }; } using namespace Kopete; KopeteAwayDialog::KopeteAwayDialog(){} novell78625.cc:10: error: 'KopeteAwayDialog' has not been declared novell78625.cc:10: error: ISO C++ forbids declaration of 'KopeteAwayDialog' with no type This is a regression from 3.3/3.4. Current mainline is ok, however, most probably due to these patches from Kriang: 2005-03-14 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net> PR c++/4403 PR c++/9783, DR433 2005-03-14 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net> Friend class name lookup 5/n PR c++/1016
Note 3.x did not friend the right class, it should have friended Kopete::KopeteAwayDialog but instead friends ::KopeteAwayDialog. In 4.0.0 we friend the wrong class bug declare the class which is where the problem comes from. In 4.1.0 we do correct thing in that we friend the correct class and now the new class is not declared. Anyways this is a dup of bug 19403. *** This bug has been marked as a duplicate of 19403 ***