Have you already tried a forward declaration, like this:
namespace myspace {
class x; // forward declaration of class myspace::x
};
class y {
friend myspace::x;
};
GOTOs are a bit like wire coat hangers: they tend to breed in the darkness, such that where there once were few, eventually there are many, and the program's architecture collapses beneath them. (Fran Poretto)