Class A not visible in class C but visible in main. Why?
<pre><code>class A {};

class B : private A {

};

class C : public B {
public:
    void f() {
        A a; // This line causes error, but works when it is in main() function
    }

};

int main()
{
    C c;
    // A a; --&gt; This line works
    return 0;
}
</code></pre>

<p>I am guessing this has something to do with <code>B</code> inheriting privately from <code>A</code> but cannot put my finger on it. </p>

<p>EDIT: Error is "class A is not visible". Compiled with g++.</p>
