Avoid new warning C5267 for deprecated implicit copy ctor/assign #3497
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
@JonCavesMSFT just implemented a new off-by-default warning for VS 2022 17.7 Preview 1 (internal MSVC-PR-452406) that some internal teams are very interested in using. This warns about the deprecated case in WG21-N4928 [class.copy.ctor]/6 (emphasis mine):
and [class.copy.assign]/2 (emphasis mine):
The warning (which uses the same number for copy ctors and copy assigns) looks like:
We can't enable the warning until 17.7 Preview 1 ships, but we can clean up the product and test code now. (When we enable the warning, the proper places to do so will likely be
tests/std/tests/prefix.lst
andtests/tr1/prefix.lst
, unlesslibcxx
receives numerous cleanups, in which casetests/universal_prefix.lst
will be the place.)I have filed VSO-1753270 "
/clr
C++20alignas
with defaulted SMFs emits fatal error C1193: an error expected in ...\yyaction.cpp(2976) not reached", which prevents one type from being cleaned up here (aligned_type
inP0220R1_any
).Notes
bitset
tuple<>
The Wise?). However, this should be ABI-safe because the copy ctor is being defaulted and therefore remains trivial._CONSTEXPR23
to match the WP. (It is implicitlynoexcept
.)reference::flip
to match the WP's order.P0220R1_any
count
, to keep it balanced with the destructor. They must be markednoexcept
so that these types remain eligible forany
's Small Object Optimization:STL/stl/inc/any
Lines 51 to 53 in 86acfb1
P0220R1_optional
X
also needs a defaulted default ctor (otherwise the defaulted copy ctor will suppress it).P0608R3_improved_variant_converting_constructor
convertible_bool
didn't need a defaulted destructor at all, so I have simply dropped it.P0674R1_make_shared_for_arrays
WeirdDeleter
needs a defaulted default ctor.P0784R7_library_support_for_more_constexpr_containers
constexpr
andnoexcept
for local consistency, although I could be persuaded otherwise.P0896R4_views_join
non_trivially_destructible_input_iterator
didn't have any way to construct a fresh object (it intentionally deletes its default ctor below). I've seen compilers warn about that, so it seems prudent to introduce a hypothetical ctor, which I've commented.