title: Why does 'outer inline' template does not compile?
body: <p>Ok, so here is a code :</p>
  
  <pre><code>#include &lt;sstream&gt;
  
  struct A {
      class Type {};
      template &lt; typename Type &gt;
      Type as( void ) {
          std::istringstream test;
  
          Type temp;
          test &gt;&gt; temp;
  
          return temp;
      }
  };
  </code></pre>
  
  <p>It compiles fine, no problem at all.</p>
  
  <p>Now, here is <em>almost</em> the same code :</p>
  
  <pre><code>#include &lt;sstream&gt;
  
  struct A {
      class Type {};
      template &lt; typename Type &gt;
      inline Type as(void);
  };
  
  template &lt; typename Type &gt;
  Type A::as( void ) {
      std::istringstream test;
  
      Type temp;
      test &gt;&gt; temp;
  
      return temp;
  }
  </code></pre>
  
  <p>Boom, it doesn't compile anymore. Error :</p>
  
  <pre><code>t.cc:14:10: error: invalid operands to binary expression ('std::istringstream' (aka 'basic_istringstream&lt;char&gt;') and 'A::Type')
      test &gt;&gt; temp;
      ~~~~ ^  ~~~~
  </code></pre>
  
  <p>I have reproduced this behavior with clang and gcc.</p>
  
  <p>Why are the compilers using the wrong type in the second case ? (just to be clear : I know that there is a conflict with the enumeration, but from my understanding, the first code should also fail to compile if it was the real problem)</p>