Different output on different compilers
<p>Why does the following code prints different results on different compilers?</p>

<pre><code>#include &lt;iostream&gt;

void foo() { std::cout &lt;&lt; "::foo() \n"; }

namespace Foo
{
   struct Bar
   {
      friend void foo() { std::cout &lt;&lt; "Bar::foo() \n"; }
      void bar() { foo(); }
      void baz();
   };

   void Bar::baz() { foo(); }
}

int main()
{
   Foo::Bar instance;
   instance.bar();
   instance.baz();
}
</code></pre>

<p><strong>Output</strong></p>

<p>gcc 4.7.2</p>

<blockquote>
<pre><code>::foo()
::foo()
</code></pre>
</blockquote>

<p>MSVC-10.0</p>

<blockquote>
<pre><code>Bar::foo()
Bar::foo()
</code></pre>
</blockquote>

<p>MSVC-11.0</p>

<blockquote>
<pre><code>error C3861: 'foo': identifier not found
error C3861: 'foo': identifier not found
</code></pre>
</blockquote>

<p>Who is right? And why is it so?</p>
