title: Non-const copy constructor and implicit conversions on return value
body: <p>Consider the following C++ code:</p>
  
  <pre><code>struct B { };
  struct A
  {
          A(int);
          A(A&amp;); // missing const is intentional
          A(B);
          operator B();
  };
  
  A f()
  {
          // return A(1); // compiles fine
          return 1; // doesn't compile
  }
  </code></pre>
  
  <p>This compiles fine on MSVC++ 2010 (in fact, on MSVC it even works if I remove <code>B</code> altogether). It doesn't on GCC 4.6.0:</p>
  
  <pre><code>conv.cpp: In function ‘A f()’:
  conv.cpp:13:9: error: no matching function for call to ‘A::A(A)’
  conv.cpp:13:9: note: candidates are:
  conv.cpp:6:2: note: A::A(B)
  conv.cpp:6:2: note:   no known conversion for argument 1 from ‘A’ to ‘B’
  conv.cpp:5:2: note: A::A(A&amp;)
  conv.cpp:5:2: note:   no known conversion for argument 1 from ‘A’ to ‘A&amp;’
  conv.cpp:4:2: note: A::A(int)
  conv.cpp:4:2: note:   no known conversion for argument 1 from ‘A’ to ‘int’
  </code></pre>
  
  <p>What's confusing me is the message <code>no known conversion for argument 1 from ‘A’ to ‘B’</code>. How can this be true considering that <code>A::operator B()</code> is very well defined?</p>