title: Friend lookup exception from template-id?
body: <p>Consider the following clause in [namespace.memdef]/3:</p>
  
  <blockquote>
    <p>If the name in a <code>friend</code> declaration is neither
    qualified nor a <em>template-id</em> and the declaration is a function or an <em>elaborated-type-specifier</em>, the lookup to determine whether the entity has been previously declared shall not consider any scopes outside the innermost
    enclosing namespace.</p>
  </blockquote>
  
  <p>Is there a reason for the exception for <em>template-id</em> along with the qualified name? For that matter, is there a reason for the lookup of an unqualified name that isn't a <em>template-id</em> to be restricted to the innermost enclosing namespace? Is there a specific problem or use-case that this clause solves?</p>