From e4a148963e82ff2f34c794de0ad7ad3fa2e7b123 Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Tue, 15 May 2018 20:57:56 -0400 Subject: [PATCH] cp-tree.h (cp_expr): Remove copy constructor. * cp-tree.h (cp_expr): Remove copy constructor. * mangle.c (struct releasing_vec): Declare copy constructor. From-SVN: r260279 --- gcc/cp/ChangeLog | 3 +++ gcc/cp/cp-tree.h | 3 --- gcc/cp/mangle.c | 4 ++++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 912a96cc94d..3ccaebef47f 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,8 @@ 2018-05-15 Jason Merrill + * cp-tree.h (cp_expr): Remove copy constructor. + * mangle.c (struct releasing_vec): Declare copy constructor. + * constexpr.c (cxx_eval_vec_init_1): Pass tf_none if ctx->quiet. PR c++/64372 - CWG 1560, gratuitous lvalue-rvalue conversion in ?: diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index 9a2eb3be4d1..cab926028b8 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -59,9 +59,6 @@ public: cp_expr (tree value, location_t loc): m_value (value), m_loc (loc) {} - cp_expr (const cp_expr &other) : - m_value (other.m_value), m_loc (other.m_loc) {} - /* Implicit conversions to tree. */ operator tree () const { return m_value; } tree & operator* () { return m_value; } diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c index 6a7df804caf..59a3111fba2 100644 --- a/gcc/cp/mangle.c +++ b/gcc/cp/mangle.c @@ -1555,6 +1555,10 @@ struct releasing_vec releasing_vec (vec_t *v): v(v) { } releasing_vec (): v(make_tree_vector ()) { } + /* Copy constructor is deliberately declared but not defined, + copies must always be elided. */ + releasing_vec (const releasing_vec &); + vec_t &operator* () const { return *v; } vec_t *operator-> () const { return v; } vec_t *get () const { return v; } -- 2.30.2