ADL, Ordinary lookup and Dependent function call not working oO
<p>Here is simple code presented which should have worked according to c++ standard <strong>I believe</strong> :</p>

<pre><code>template&lt;typename T&gt; 
void foo(T x) 
{ 
    bar(x); 
    void bar(int);
} 

void bar(int)  { } 

int main() 
{ 
    foo(0); 
} 
</code></pre>

<p>Error comes as from GCC 4.7 as:</p>

<blockquote>
  <p>‘bar’ was not declared in this scope, and no declarations were found
  by argument-dependent lookup at the point of instantiation</p>
</blockquote>

<p>But in the C++ standard it's written. § 14.6.4.2 :</p>

<blockquote>
  <p>For a function call that depends on a template parameter, the
  candidate functions are found using the usual lookup rules (3.4.1,
  3.4.2, 3.4.3) except that: </p>
  
  <p><strong>— For the part of the lookup using unqualified name lookup (3.4.1)</strong> or qualified name lookup (3.4.3), <strong>only function declarations from the template definition context are found.</strong></p>
</blockquote>

<p>I may be have got the wrong impression of what's written, can anyone please correct me here?</p>
