Code is something like

class GUSIDeviceRegistry {
public:
class iterator;
};

class GUSIDevice {
public:
friend class GUSIDeviceRegistry;
friend class GUSIDeviceRegistry::iterator;
};

class GUSIDeviceRegistry::iterator {
};

The issue with the friend declaration to a forward declared class aside, the error message is definitely misleading because there is nothing wrong with GUSIDeviceRegistry (and the first friend declaration succeeded without a peep).