[LLVMbugs] [Bug 19123] deprecated warning for implicit copy constructor doesn't notice the destructor is defaulted

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Mar 13 08:03:28 PDT 2014


http://llvm.org/bugs/show_bug.cgi?id=19123

David Blaikie <dblaikie at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |dblaikie at gmail.com
         Resolution|---                         |INVALID

--- Comment #1 from David Blaikie <dblaikie at gmail.com> ---
This deprecation is enshrined in the C++11 standard:

" If the class definition declares a move constructor or move assignment
operator, the implicitly declared copy
assignment operator is defined as deleted; otherwise, it is defined as defaulted
(8.4). The latter case is
deprecated if the class has a user-declared copy constructor or a user-declared
destructor."

So "= default" doesn't help here.

Note that this is even more problematic in the face of move operations -
defining an implicit move op as explicitly defaulted will disable (define as
deleted, as seen in the above wording) copy operations.

Providing implicit ops explicitly with = default isn't a noop and should be
avoided.

-- 
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/20140313/b5b46278/attachment.html>


More information about the llvm-bugs mailing list