[LLVMbugs] [Bug 18005] New: Implicit move destructor implicitly deleted when base class is trivially copyable

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Nov 20 05:41:26 PST 2013


            Bug ID: 18005
           Summary: Implicit move destructor implicitly deleted when base
                    class is trivially copyable
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++11
          Assignee: unassignedclangbugs at nondot.org
          Reporter: bmerry at gmail.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 11572
  --> http://llvm.org/bugs/attachment.cgi?id=11572&action=edit
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
(http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59213) 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.

You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20131120/7d8ac43e/attachment.html>

More information about the llvm-bugs mailing list