Private base class accessibility in C++
<p>I recently had to do something like this:</p>

<pre><code>class A { };
class B : private A { };
class C : public B {
    public:
        A *myA;
};

int main() {
    return 0;
}
</code></pre>

<p>And I get an error in the three compilers I tried. When I changed the declaration of <code>myA</code> to <code>::A *myA</code> everything works ok. I poked around in the C++ standard and found Section 11.2, paragraph 3 where it says:</p>

<blockquote>
  <p>Note: A member of a private base class might be inaccessible as an inherited member name, but accessible directly.</p>
</blockquote>

<p>Which is relevant, but unclear. Why is the name <code>A</code> inaccessible? What problems would occur if <code>A</code> was not hidden?</p>

<p>Thanks,
<br>-Ben</p>
