diff options
author | Jason Merrill <jason@redhat.com> | 2018-05-18 16:02:48 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2018-05-18 16:02:48 -0400 |
commit | b46b715d5b838d9869f89d3594ebf7d0b7cb374c (patch) | |
tree | 5684d331d1a9d9e995bb252f9febf8e86618a0a5 /gcc/doc | |
parent | f07c22376848e9923aa8455d2c0a059d9d0e01d5 (diff) | |
download | gcc-b46b715d5b838d9869f89d3594ebf7d0b7cb374c.zip gcc-b46b715d5b838d9869f89d3594ebf7d0b7cb374c.tar.gz gcc-b46b715d5b838d9869f89d3594ebf7d0b7cb374c.tar.bz2 |
PR c++/58407 - deprecated implicit copy ops.
gcc/c-family/
* c.opt (Wdeprecated-copy): New flag.
gcc/cp/
* call.c (build_over_call): Warn about deprecated trivial fns.
* class.c (classtype_has_user_copy_or_dtor): New.
(type_build_ctor_call): Check TREE_DEPRECATED.
(type_build_dtor_call): Likewise.
* decl2.c (cp_warn_deprecated_use): Move from tree.c.
Add checks. Return bool. Handle -Wdeprecated-copy.
(mark_used): Use it.
* decl.c (grokdeclarator): Remove redundant checks.
* typeck2.c (build_functional_cast): Likewise.
* method.c (lazily_declare_fn): Mark deprecated copy ops.
* init.c (build_aggr_init): Only set TREE_USED if there are
side-effects.
libitm/
* beginend.cc (save): Disable -Werror=deprecated-copy.
From-SVN: r260381
Diffstat (limited to 'gcc/doc')
-rw-r--r-- | gcc/doc/invoke.texi | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 612b97c..44b0433 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -213,7 +213,8 @@ in the following sections. -fvisibility-ms-compat @gol -fext-numeric-literals @gol -Wabi=@var{n} -Wabi-tag -Wconversion-null -Wctor-dtor-privacy @gol --Wdelete-non-virtual-dtor -Wliteral-suffix -Wmultiple-inheritance @gol +-Wdelete-non-virtual-dtor -Wdeprecated-copy -Wliteral-suffix @gol +-Wmultiple-inheritance @gol -Wnamespaces -Wnarrowing @gol -Wnoexcept -Wnoexcept-type -Wclass-memaccess @gol -Wnon-virtual-dtor -Wreorder -Wregister @gol @@ -2900,6 +2901,14 @@ an instance of a derived class through a pointer to a base class if the base class does not have a virtual destructor. This warning is enabled by @option{-Wall}. +@item -Wdeprecated-copy @r{(C++ and Objective-C++ only)} +@opindex Wdeprecated-copy +@opindex Wno-deprecated-copy +Warn that the implicit declaration of a copy constructor or copy +assignment operator is deprecated if the class has a user-provided +copy constructor, copy assignment operator, or destructor, in C++11 +and up. This warning is enabled by @option{-Wall}. + @item -Wliteral-suffix @r{(C++ and Objective-C++ only)} @opindex Wliteral-suffix @opindex Wno-literal-suffix |