From cd0c3137f8a21968ce147251633b8dbdde8829e7 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sun, 22 Dec 2019 11:58:44 +0000 Subject: [PATCH] Merge commit f97936fab from llvm git (by Eric Fiselier): [libc++] Cleanup and enable multiple warnings. Too many warnings are being disabled too quickly. Warnings are important to keeping libc++ correct. This patch re-enables two warnings: -Wconstant-evaluated and -Wdeprecated-copy. In future, all warnings disabled for the test suite should require an attached bug. The bug should state the plan for re-enabling that warning, or a strong case why it should remain disabled. This should fix a number of new g++ 9 warnings. Requested by: rlibby MFC after: 3 days --- .../libcxx/include/__bit_reference | 6 ++++- .../llvm-project/libcxx/include/__hash_table | 6 +++-- contrib/llvm-project/libcxx/include/__tree | 5 +++- .../llvm-project/libcxx/include/ext/hash_map | 5 ++-- contrib/llvm-project/libcxx/include/random | 2 ++ contrib/llvm-project/libcxx/include/valarray | 26 +++++-------------- 6 files changed, 25 insertions(+), 25 deletions(-) diff --git a/contrib/llvm-project/libcxx/include/__bit_reference b/contrib/llvm-project/libcxx/include/__bit_reference index cce74fb50236..62c862490105 100644 --- a/contrib/llvm-project/libcxx/include/__bit_reference +++ b/contrib/llvm-project/libcxx/include/__bit_reference @@ -1108,8 +1108,12 @@ public: #endif {} + // avoid re-declaring a copy constructor for the non-const version. + using __type_for_copy_to_const = + _If<_IsConst, __bit_iterator<_Cp, false>, struct __private_nat>; + _LIBCPP_INLINE_VISIBILITY - __bit_iterator(const __bit_iterator<_Cp, false>& __it) _NOEXCEPT + __bit_iterator(const __type_for_copy_to_const& __it) _NOEXCEPT : __seg_(__it.__seg_), __ctz_(__it.__ctz_) {} _LIBCPP_INLINE_VISIBILITY reference operator*() const _NOEXCEPT diff --git a/contrib/llvm-project/libcxx/include/__hash_table b/contrib/llvm-project/libcxx/include/__hash_table index 0b953f58e99e..7ba3cebd0941 100644 --- a/contrib/llvm-project/libcxx/include/__hash_table +++ b/contrib/llvm-project/libcxx/include/__hash_table @@ -825,11 +825,13 @@ private: allocator_type& __na_; - __hash_node_destructor& operator=(const __hash_node_destructor&); - public: bool __value_constructed; + __hash_node_destructor(__hash_node_destructor const&) = default; + __hash_node_destructor& operator=(const __hash_node_destructor&) = delete; + + _LIBCPP_INLINE_VISIBILITY explicit __hash_node_destructor(allocator_type& __na, bool __constructed = false) _NOEXCEPT diff --git a/contrib/llvm-project/libcxx/include/__tree b/contrib/llvm-project/libcxx/include/__tree index 15b03ec857f6..4a41cb34f00b 100644 --- a/contrib/llvm-project/libcxx/include/__tree +++ b/contrib/llvm-project/libcxx/include/__tree @@ -775,11 +775,14 @@ private: typedef __tree_node_types _NodeTypes; allocator_type& __na_; - __tree_node_destructor& operator=(const __tree_node_destructor&); public: bool __value_constructed; + + __tree_node_destructor(const __tree_node_destructor &) = default; + __tree_node_destructor& operator=(const __tree_node_destructor&) = delete; + _LIBCPP_INLINE_VISIBILITY explicit __tree_node_destructor(allocator_type& __na, bool __val = false) _NOEXCEPT : __na_(__na), diff --git a/contrib/llvm-project/libcxx/include/ext/hash_map b/contrib/llvm-project/libcxx/include/ext/hash_map index 24823c6bf0cc..a0a03b5b8917 100644 --- a/contrib/llvm-project/libcxx/include/ext/hash_map +++ b/contrib/llvm-project/libcxx/include/ext/hash_map @@ -315,12 +315,13 @@ private: allocator_type& __na_; - __hash_map_node_destructor& operator=(const __hash_map_node_destructor&); - public: bool __first_constructed; bool __second_constructed; + __hash_map_node_destructor(__hash_map_node_destructor const&) = default; + __hash_map_node_destructor& operator=(const __hash_map_node_destructor&) = delete; + _LIBCPP_INLINE_VISIBILITY explicit __hash_map_node_destructor(allocator_type& __na) : __na_(__na), diff --git a/contrib/llvm-project/libcxx/include/random b/contrib/llvm-project/libcxx/include/random index 994bea4a4b4e..4718fad6f520 100644 --- a/contrib/llvm-project/libcxx/include/random +++ b/contrib/llvm-project/libcxx/include/random @@ -6105,6 +6105,7 @@ public: template param_type(size_t __nw, result_type __xmin, result_type __xmax, _UnaryOperation __fw); + param_type(param_type const&) = default; param_type & operator=(const param_type& __rhs); _LIBCPP_INLINE_VISIBILITY @@ -6428,6 +6429,7 @@ public: template param_type(size_t __nw, result_type __xmin, result_type __xmax, _UnaryOperation __fw); + param_type(param_type const&) = default; param_type & operator=(const param_type& __rhs); _LIBCPP_INLINE_VISIBILITY diff --git a/contrib/llvm-project/libcxx/include/valarray b/contrib/llvm-project/libcxx/include/valarray index 8f6221ab3f39..c048a6d7e498 100644 --- a/contrib/llvm-project/libcxx/include/valarray +++ b/contrib/llvm-project/libcxx/include/valarray @@ -1256,6 +1256,8 @@ public: _LIBCPP_INLINE_VISIBILITY operator>>=(const _Expr& __v) const; + slice_array(slice_array const&) = default; + _LIBCPP_INLINE_VISIBILITY const slice_array& operator=(const slice_array& __sa) const; @@ -1505,11 +1507,6 @@ public: #endif // _LIBCPP_CXX03_LANG -// gslice(const gslice&) = default; -// gslice(gslice&&) = default; -// gslice& operator=(const gslice&) = default; -// gslice& operator=(gslice&&) = default; - _LIBCPP_INLINE_VISIBILITY size_t start() const {return __1d_.size() ? __1d_[0] : 0;} @@ -1645,10 +1642,7 @@ public: _LIBCPP_INLINE_VISIBILITY void operator=(const value_type& __x) const; -// gslice_array(const gslice_array&) = default; -// gslice_array(gslice_array&&) = default; -// gslice_array& operator=(const gslice_array&) = default; -// gslice_array& operator=(gslice_array&&) = default; + gslice_array(const gslice_array&) = default; private: gslice_array(const gslice& __gs, const valarray& __v) @@ -1977,17 +1971,14 @@ public: _LIBCPP_INLINE_VISIBILITY operator>>=(const _Expr& __v) const; + mask_array(const mask_array&) = default; + _LIBCPP_INLINE_VISIBILITY const mask_array& operator=(const mask_array& __ma) const; _LIBCPP_INLINE_VISIBILITY void operator=(const value_type& __x) const; -// mask_array(const mask_array&) = default; -// mask_array(mask_array&&) = default; -// mask_array& operator=(const mask_array&) = default; -// mask_array& operator=(mask_array&&) = default; - private: _LIBCPP_INLINE_VISIBILITY mask_array(const valarray& __vb, const valarray& __v) @@ -2336,17 +2327,14 @@ public: _LIBCPP_INLINE_VISIBILITY operator>>=(const _Expr& __v) const; + indirect_array(const indirect_array&) = default; + _LIBCPP_INLINE_VISIBILITY const indirect_array& operator=(const indirect_array& __ia) const; _LIBCPP_INLINE_VISIBILITY void operator=(const value_type& __x) const; -// indirect_array(const indirect_array&) = default; -// indirect_array(indirect_array&&) = default; -// indirect_array& operator=(const indirect_array&) = default; -// indirect_array& operator=(indirect_array&&) = default; - private: _LIBCPP_INLINE_VISIBILITY indirect_array(const valarray& __ia, const valarray& __v)