title: Copy assignment not chosen
body: <p>Given the following code snippet, why isn't the copy assignment operator chosen? </p>
  
  <p>It doesn't compile complaining about the copy constructor being deleted. I tried with a user declared assignment operator, but it still didn't work. So it isn't an implicit generation rule being broken (which would prevent <code>=default</code> to work).</p>
  
  <pre><code>struct obj {
      obj() = default;
      ~obj() = default;
  
      obj(const obj&amp;) = delete;
      obj(obj&amp;&amp;) = default;
  
      obj&amp; operator=(const obj&amp;) = default;
      // obj&amp; operator=(const obj&amp;) {return *this;} // nada
      obj&amp; operator=(obj&amp;&amp;) = default;
  
      int t{42};
  };
  
  int main(int, char**) {
      obj o1;
      obj o2 = o1; // &lt;-- problem is here
  
      // but this is ok
      obj o3;
      o3.operator=(o1);
  
      // or this
      obj o4;
      o4 = o1;
  }
  </code></pre>
  
  <p>Here is a godbolt example : <a href="https://godbolt.org/z/MkZuGs" rel="nofollow noreferrer">https://godbolt.org/z/MkZuGs</a></p>
  
  <p>I tried a couple compilers. My guess is somehow, the declaration <em>has</em> to call the copy constructor, but I just don't see how or why.</p>