[Bug c++/58407] [C++11] Should warn about deprecated implicit generation of copy constructor/assignment
jason at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri May 18 23:43:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58407
Jason Merrill <jason at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution|--- |FIXED
--- Comment #16 from Jason Merrill <jason at gcc dot gnu.org> ---
(In reply to Jason Merrill from comment #14)
> An interesting subcategory I noticed when I had the warning on by default is
> classes with a virtual destructor, such as the exception hierarchy. The
> warning calls attention to potential slicing problems, and so I think we
> don't want to add defaulted copy ops; it's good for users to be encouraged
> to e.g. catch by reference.
For the record, I changed my mind about this; a slicing warning should only
apply to copies from an object of unknown dynamic type.
-Wdeprecated-copy added for GCC 9.
More information about the Gcc-bugs
mailing list