no return statement in friend class
<p>The warning is being generated by the <code>ostream &amp; operator&lt;&lt;(ostream &amp;os, A &amp;A0)</code> function.</p>

<h1>Here's how the class's defined:</h1>

<pre><code>class A
{
    public:
        friend ostream &amp; operator&lt;&lt;(ostream &amp;os, A &amp;A0);
        A&amp; operator=(string strSlot_);
        A&amp; operator+(string strSlot_);
        A&amp; operator+(const A &amp;B);
        A&amp; operator=(const A &amp;B);
        string slotReturn();
        A(string strSlot_);
        A(const A &amp;object);
        void slotChange();
        void sCout();
        ~A();
        A();
    private:
        string strSlot;
        int n;
};


ostream &amp; operator&lt;&lt;(ostream &amp;os, A &amp;A0)
{
    os &lt;&lt; "strSlot = \"" &lt;&lt; A0.slotReturn() &lt;&lt; "\"" &lt;&lt; endl;
}

string A::slotReturn()
{
    return strSlot;
}
</code></pre>

<hr>

<p>The question is, what is it supposed to return? <code>*this</code> doesn't seem to work (because it's a <code>friend</code>?). (It's merely a warning, but still, I just want to know.)</p>

<p>Also, why can't I pass <code>A &amp;A0</code> as a const (in which case the error is: "passing 'const A' as 'this' argument of 'std::string A::slotReturn()' discards qualifiers")?</p>
