title: template base class typedef members invisible
body: <p>I'm aware of the fact that the 'dependent names' are not visible to the compiler by default.  But I was told in answers to other SO questions (<a href="https://stackoverflow.com/questions/12514673/cant-access-members-of-a-template-base-class-within-a-derived-template-class">here</a>, <a href="https://stackoverflow.com/questions/1120833/derived-template-class-access-to-base-class-member-data">here</a>, and ultimately <a href="http://www.parashift.com/c++-faq-lite/nondependent-name-lookup-members.html" rel="nofollow noreferrer">on the C++ faq</a>) that a <code>using</code> declaration may help.</p>
  
  <p>So I tried.</p>
  
  <p>A template base class:</p>
  
  <pre><code>// regardless of the fact that members are exposed...
  template&lt;typename T&gt;
  struct TBase {
     typedef T MemberType;
     MemberType baseMember;
     MemberType baseFunction() { return MemberType(); }
  };
  </code></pre>
  
  <p>And a derived class, using the base's members:</p>
  
  <pre><code>template&lt;typename T&gt;
  struct TDerived : public TBase&lt;T&gt; {
     // http://www.parashift.com/c++-faq-lite/nondependent-name-lookup-members.html
     // tells us to use a `using` declaration.
     using typename TBase&lt;T&gt;::MemberType;
     using TBase&lt;T&gt;::baseFunction;
     using TBase&lt;T&gt;::baseMember;
  
     void useBaseFunction() { 
        // this goes allright.
        baseFunction();
        ++baseMember;
  
        // but here, the compiler doesn't want to help...
        MemberType t; //error: expected `;' before ‘t’
     }
  };
  </code></pre>
  
  <p>I tried <a href="http://ideone.com/iUsXKG" rel="nofollow noreferrer">this out on ideone</a>. It has gcc-4.3.3 and gcc-4.5.1 </p>
  
  <p>Is this expected behavior?  How are we supposed to work around the 'dependent name' law for accessing parent template class' member typedefs?</p>