title: Disagreement on Using Type Aliases in Nested Classes
body: <p>clang++ and g++ disagree about the validity of the following code:</p>
  
  <pre><code>template&lt;typename T&gt;
  struct thing {
      struct nested {
          typename thing::type num;
      };
      using type = int;
  };
  </code></pre>
  
  <p>All versions of g++ (4.8 and up) compile this without issue, all versions of clang (3.0 and up) complain about <code>thing::type</code> not being defined.</p>
  
  <p>Obviously if <code>thing</code> weren't a template, neither compiler would accept this, but who is correct here, and why?</p>
  
  <p>Thanks in advance.</p>