diff options
| author | Fangrui Song <maskray@google.com> | 2019-12-05 15:54:08 -0800 |
|---|---|---|
| committer | Fangrui Song <maskray@google.com> | 2019-12-12 16:31:36 -0800 |
| commit | b7eb30d48131c0b42cf5fa5bf866e846959876c2 (patch) | |
| tree | dbc9f13551051d10fbfce2cd8c6caa459e70795a /libcxx/include/__bit_reference | |
| parent | dabd2622a86900718ce5ba22e787333265375d4a (diff) | |
| download | bcm5719-llvm-b7eb30d48131c0b42cf5fa5bf866e846959876c2.tar.gz bcm5719-llvm-b7eb30d48131c0b42cf5fa5bf866e846959876c2.zip | |
__bit_reference: fix -Wdeprecated-copy warnings
Since C++11, [depr.impldec]:
The implicit definition of a copy constructor as defaulted is deprecated
if the class has a user-declared copy assignment operator or a
user-declared destructor.
At clang HEAD, -Wdeprecated-copy (included by -Wextra) will warn on such instances.
Reviewed By: EricWF
Differential Revision: https://reviews.llvm.org/D71096
Diffstat (limited to 'libcxx/include/__bit_reference')
| -rw-r--r-- | libcxx/include/__bit_reference | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/libcxx/include/__bit_reference b/libcxx/include/__bit_reference index 05dfbe7e9ff..bbc15983424 100644 --- a/libcxx/include/__bit_reference +++ b/libcxx/include/__bit_reference @@ -47,6 +47,9 @@ class __bit_reference friend class __bit_const_reference<_Cp>; friend class __bit_iterator<_Cp, false>; public: + _LIBCPP_INLINE_VISIBILITY + __bit_reference(const __bit_reference&) = default; + _LIBCPP_INLINE_VISIBILITY operator bool() const _NOEXCEPT {return static_cast<bool>(*__seg_ & __mask_);} _LIBCPP_INLINE_VISIBILITY bool operator ~() const _NOEXCEPT @@ -133,6 +136,9 @@ class __bit_const_reference friend class __bit_iterator<_Cp, true>; public: _LIBCPP_INLINE_VISIBILITY + __bit_const_reference(const __bit_const_reference&) = default; + + _LIBCPP_INLINE_VISIBILITY __bit_const_reference(const __bit_reference<_Cp>& __x) _NOEXCEPT : __seg_(__x.__seg_), __mask_(__x.__mask_) {} @@ -147,7 +153,7 @@ private: __bit_const_reference(__storage_pointer __s, __storage_type __m) _NOEXCEPT : __seg_(__s), __mask_(__m) {} - __bit_const_reference& operator=(const __bit_const_reference& __x); + __bit_const_reference& operator=(const __bit_const_reference&) = delete; }; // find |

