public field of a class not visible in its subclass
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/11405/gcc-problem-using-a-member-of-a-base-class-that-depends-on-a-template-argument">GCC problem : using a member of a base class that depends on a template argument</a>  </p>
</blockquote>



<pre><code>template &lt;typename AType, typename OuterClass&gt;
class A{
public:
    A (AType a, OuterClass &amp; b) : a(a), b(b) { }
    AType a;
    const OuterClass &amp; b;
};

template &lt;typename T&gt;
class B {
public:
    class C : public A&lt;int, B&gt; {
        C(const B &amp; b) : A&lt;int, B&gt;(0, b) {} 
        int getA() { return a; }
    };
};
</code></pre>

<p>This code is a little long, but it's the minimal example I could find to reproduce my problem. Class C should inherit field "a" from its superclass A, and visual c++ compiles it without errors. But for some reason under gcc, in function getA I get "error: ‘a’ was not declared in this scope". What's wrong with this code and how can I make it more portable?</p>
