global operator new, private c-tor and friend
<p>In the following code:</p>

<pre><code>class A
{
    A() {}
    friend class B;
};

class B
{
public:
    void foo() {A* p=new A;};
};


int main()
{
    B b;
    b.foo();

    A* p = new A;

    return 0;
}
</code></pre>

<p>The function <code>foo()</code> passes compilation, however the line <code>A* p = new A;</code> does not. How can this be? <code>new</code> is a global operator, thus it cannot call the private constructor, so why doesn't the compiler complain about <code>foo()</code> as well?</p>
