[libcxx-commits] [PATCH] D71096: __bit_reference: fix -Wdeprecated-copy warnings
Eric Fiselier via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Thu Dec 12 16:11:27 PST 2019
EricWF added a comment.
LGTM given the use of `= default` and `= delete`.
================
Comment at: libcxx/include/__bit_reference:51
+ _LIBCPP_INLINE_VISIBILITY
+ __bit_reference(const __bit_reference& __x) _NOEXCEPT : __seg_(__x.__seg_),
+ __mask_(__x.__mask_) {}
----------------
`= default` is C++03 compatible because we allow extensions.
Please go back to using `= default`.
================
Comment at: libcxx/include/__bit_reference:150
-
- __bit_const_reference& operator=(const __bit_const_reference& __x);
};
----------------
dblaikie wrote:
> MaskRay wrote:
> > It seems this isn't defined, so I just delete it.
> Perhaps it was intended to be declared-but-not-defined to disable the use of copy assignment for this type? (in the days before "= delete" this is how things were done - declare the function privately without a definition)
Yes, please `= delete` this.
(As mentioned above `= delete` can be used in C++03 as well).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D71096/new/
https://reviews.llvm.org/D71096
More information about the libcxx-commits
mailing list