Assignment from rvalue allowed when assignment operator explicitly deleted?
<p>Consider the following code, which compiles under Clang, GCC, and VS 2015 (<a href="https://godbolt.org/g/Vddp7j" rel="nofollow">online example</a>):</p>

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

class S 
{
public:
    S(int x) : i(x) { }
    ~S() { }

    S(S&amp;&amp;)  = default;

    S(const S&amp; )            = delete;
    S&amp; operator=(S&amp;&amp;)       = delete;
    S&amp; operator=(const S&amp;)  = delete;

private:
    int i;
};

S GetS() 
{ 
    // This is a contrived example with details elided. Assume 
    // there's a reason in the actual use case for returning via 
    // std::move.
    return std::move( S(999) ); 
}

int main()
{
    S tmp = GetS(); // &lt;-- Assignment allowed even though assignment operator is deleted?

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

<p>I'm unclear as to why the line</p>

<pre><code>S tmp = GetS(); 
</code></pre>

<p>compiles, executing the move constructor instead of the move assignment operator.</p>

<p>I know that RVO allows construction and assignment to be elided as an optimization, but it was my understanding that explicitly deleting an operator should cause compilation to fail if that operator is explicitly used in the code.</p>

<p>Is there some clause in the C++11 specification that allows a compiler to transform assignment initialization into copy construction, even when assignment operators for a type have been explicitly deleted?</p>