aboutsummaryrefslogtreecommitdiff
path: root/libitm
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2018-05-18 16:02:48 -0400
committerJason Merrill <jason@gcc.gnu.org>2018-05-18 16:02:48 -0400
commitb46b715d5b838d9869f89d3594ebf7d0b7cb374c (patch)
tree5684d331d1a9d9e995bb252f9febf8e86618a0a5 /libitm
parentf07c22376848e9923aa8455d2c0a059d9d0e01d5 (diff)
downloadgcc-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 'libitm')
-rw-r--r--libitm/ChangeLog4
-rw-r--r--libitm/beginend.cc5
2 files changed, 9 insertions, 0 deletions
diff --git a/libitm/ChangeLog b/libitm/ChangeLog
index 1758b6a..7791d9e 100644
--- a/libitm/ChangeLog
+++ b/libitm/ChangeLog
@@ -1,3 +1,7 @@
+2018-05-17 Jason Merrill <jason@redhat.com>
+
+ * beginend.cc (save): Disable -Werror=deprecated-copy.
+
2018-05-02 Tom de Vries <tom@codesourcery.com>
PR testsuite/85106
diff --git a/libitm/beginend.cc b/libitm/beginend.cc
index 1669442..057d458 100644
--- a/libitm/beginend.cc
+++ b/libitm/beginend.cc
@@ -431,7 +431,12 @@ GTM::gtm_transaction_cp::save(gtm_thread* tx)
// Save everything that we might have to restore on restarts or aborts.
jb = tx->jb;
undolog_size = tx->undolog.size();
+
+ /* FIXME! Assignment of an aatree like alloc_actions is unsafe; if either
+ *this or *tx is destroyed, the other ends up pointing to a freed node. */
+#pragma GCC diagnostic warning "-Wdeprecated-copy"
alloc_actions = tx->alloc_actions;
+
user_actions_size = tx->user_actions.size();
id = tx->id;
prop = tx->prop;