title: Where does the C++98 standard specify when a call to a static member is dependent within a template?
body: <p>Compiling with Clang 3.0 -std=c++98, the following code is accepted:</p>
  
  <pre><code>template&lt;int&gt;
  struct I
  {
      typedef int Type;
  };
  
  template&lt;class&gt;
  struct S
  {
      static int f(int);
      //static int f(int*);
  
      // implicitly instantiates I&lt;sizeof(int)&gt;
      typedef I&lt;sizeof(f(0))&gt;::Type Type; 
  };
  
  S&lt;int&gt;::Type s;
  </code></pre>
  
  <p>Uncommenting the overload of 'f' causes Clang to report an error "missing 'typename' prior to dependent type name". G++ 4.8 reports the same error with or without the overload. msvc10 does not give any errors with or without the overload.</p>
  
  <p>Where does the standard say whether or not 'f' is dependent and 'typename' is required? If 'typename' is not required, where does the standard say whether or not overload resolution should be performed in this scenario?</p>
  
  <p>EDIT:</p>
  
  <p>To clarify: the reason I mention overload resolution is that it may be necessary to perform overload resolution to determine the value of the constant-expression 'sizeof(f(0))'. If (as I assume) overload resolution is not performed when determining whether an expression is type-dependent, the value of the constant-expression 'sizeof(f(0))' is impossible to determine (at parse time) when a dependent overload of 'f' exists: e.g.</p>
  
  <pre><code>template&lt;int&gt;
  struct I
  {
      typedef int Type;
  };
  
  template&lt;class T&gt;
  struct S
  {
      static T f(int);
  
      typedef typename I&lt;sizeof(f(0))&gt;::Type Type; 
  };
  
  S&lt;int&gt;::Type t;
  </code></pre>
  
  <p>Compiling with Clang 3.0 -std=c++98, this produces no errors. This seems correct to me, because the standard deems an expression to be type-dependent if it is an id-expression naming an object declared with a dependent type.</p>