not a class or namespace
<p>My C++ is little rusty. Can anyone see why I am seeing "not a class or namespace" compile-time error in main() while accessing i.</p>

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

using namespace std;

class Singleton2 {
    Singleton2(){
        i = 0;
    }
public:
    int i;

    friend Singleton2 &amp; singleton2();
};

Singleton2 &amp; singleton2(){
    static Singleton2 ms;

    return ms;
}

int main() {
    Singleton2 ms = singleton2();
    int i = ms::i;              // error: `ms' is not a class or namespace
    cout &lt;&lt; i &lt;&lt; endl;
}
</code></pre>
