Why can't I declare a friend through a typedef?
<p>Does anyone know why typedefs of class names don't work like class names for the friend declaration?</p>

<pre><code>class A
{
public:
};

class B : public A
{
public:
   typedef A SUPERCLASS;
};

typedef A X;

class C
{
public:
   friend class A;             // OK
   friend class X;             // fails
   friend class B::SUPERCLASS; // fails
};
</code></pre>
