<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - Implicit move destructor implicitly deleted when base class is trivially copyable"
   href="http://llvm.org/bugs/show_bug.cgi?id=18005">18005</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Implicit move destructor implicitly deleted when base class is trivially copyable
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>C++11
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>bmerry@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>dgregor@apple.com, llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=11572" name="attach_11572" title="Sample case">attachment 11572</a> <a href="attachment.cgi?id=11572&action=edit" title="Sample case">[details]</a></span>
Sample case

I'm using the Clang 3.4 snapshot shipped with Ubuntu 13.10:

$ clang++ -v
Ubuntu clang version 3.4-1ubuntu1 (trunk) (based on LLVM 3.4)
Target: x86_64-pc-linux-gnu
Thread model: posix

The attached program generates an error (pasted at the end). It appears that
Clang is not implicitly defining a move constructor for B, but as far as I can
see it ought to. B has no user-declared special members, so 12.8.10 comes into
play; and while A does not have a move constructor, it is trivially copyable,
so the last bullet of 12.8.12 does not apply.

GCC successfully compiles this code, although GCC also has a bug in this area
(<a href="http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59213">http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59213</a>) so perhaps not too much
should be read into that.


$ clang++ -std=c++11 -c move.cpp 
move.cpp:26:12: error: call to implicitly-deleted copy constructor of 'B'
    return B();
           ^~~
move.cpp:21:7: note: copy constructor of 'B' is implicitly deleted because
      field 'p' has a deleted copy constructor
    C p;
      ^
move.cpp:8:5: note: function has been explicitly marked deleted here
    C(const C &) = delete;
    ^
1 error generated.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>