title: What are the name lookup and type simplification rules for trailing return types?
body: <p>Trailing return types allow to simplify code in these two scenarios:</p>
  
  <ol>
  <li><p>Returning a type defined inside the class from one of the class's member functions:</p>
  
  <pre><code>struct X
  {
      using foo = int;
      foo f();
  };
  
  // pre-C++11
  X::foo X::f()      { /* ... */ }
  
  // trailing, doesn't require `X::` before `foo`
  auto X::f() -&gt; foo { /* ... */ }
  </code></pre></li>
  <li><p>Returning a complicated type, such as a function pointer type:</p>
  
  <pre><code>// pre-C++11
  int(*g(float))(int) { /* ... */ }
  
  // trailing, easier to read
  auto f(float) -&gt; int(*)(int) { /* ... */ }
  </code></pre></li>
  </ol>
  
  <p>I am trying to find the relevant parts of Standard that explain how the above two simplifications work. I've looked at <code>[basic.lookup]</code> and grepped for <code>trailing-return</code>, but couldn't find anything straightforward that explained how the above transformations work.</p>
  
  <p>Have I missed it? </p>
  
  <p><strong>What parts of the Standard explain the above <em>trailing-return-type</em> simplifications?</strong></p>