VS 2022 17.1
StephanTLavavej
released this
09 Mar 05:24
·
1375 commits
to main
since this release
- Merged C++20 Defect Reports:
- Merged C++23 features:
- P0448R4 #2029
<spanstream>
- P0943R6 #2008 Supporting C Atomics In C++
- Note:
<stdatomic.h>
is currently supported when compiling as C++ (/std:c++latest
). It is not yet supported when compiling as C (/std:c11
and/std:c17
), but support for C atomics is planned for a future release. For more info, see the September 2020 blog post "C11 and C17 Standard Support Arriving in MSVC".
- Note:
- P1072R10 #2258
basic_string::resize_and_overwrite
- P1147R1 #2262 Printing
volatile
Pointers - P1272R4 #2235
byteswap()
- P1425R4 #1994 Iterator Pair Constructors For
stack
Andqueue
- P1518R2 #2032 Stop Overconstraining Allocators In Container Deduction Guides
- P1659R3 #1997
ranges::starts_with
,ranges::ends_with
- P2136R3 #2019
invoke_r()
- P2251R1 #2259 Require
span
Andbasic_string_view
To Be Trivially Copyable - P2401R0 #2263 Conditional
noexcept
Forexchange()
- P0448R4 #2029
- Merged LWG issue resolutions:
- P2259R1 #2059 Repairing Input Range Adaptors And
counted_iterator
- Completed by implementing the input range adaptors part.
- LWG-3422 #2260 Issues of
seed_seq
's constructors - LWG-3506 #1994 Missing allocator-extended constructors for
priority_queue
- LWG-3520 #2200
iter_move
anditer_swap
are inconsistent fortransform_view::
iterator
- LWG-3522 #1994 Missing requirement on
InputIterator
template parameter forpriority_queue
constructors - LWG-3527 #2194
uses_allocator_construction_args
handles rvalue pairs of rvalue references incorrectly - LWG-3528 #2160
make_from_tuple
can perform (the equivalent of) a C-style cast - LWG-3536 #2037 Should
chrono::from_stream()
assign zero toduration
for failure? - LWG-3546 #1991
common_iterator
'spostfix-proxy
is not quite right - LWG-3549 #2198
view_interface
is overspecified to derive fromview_base
- LWG-3554 #2261
chrono::parse
needsconst charT*
overloads
- P2259R1 #2059 Repairing Input Range Adaptors And
- Fixed bugs:
- Fixed
<complex>
exp()
andpolar()
for infinity and NaN inputs. #1584 - Fixed compiler errors when comparing
common_iterator
s of different types for equality. #2066 - Attempting to actually call
declval()
now emits astatic_assert
citing the paragraph of the Standard that forbids this. (Previously,declval()
was declared but not defined, which was too permissive.) #2101 - Fixed
basic_streambuf::seekoff()
andbasic_streambuf::seekpos()
to work with custompos_type
s. #2121 - Restored our guarantee beyond the Standard that
string_view
is trivially move constructible. #2128 - Fixed a bug where
vector
andstring
would terminate vianoexcept
instead of throwinglength_error
as desired when asize_t
would be truncated to an allocator's narrowersize_type
. #2139 <istream>
and<ostream>
now properly catch and rethrow internal IO exceptions. #2033- Fixed
<format>
to correctly print hexfloats with large precisions. #2157 - Fixed compiler errors when using
constexpr
vector
s with certain user-defined allocators. #2161 - Fixed silent bad codegen in
ranges::stable_sort()
, where for certain inputs it would neither sort nor permute the range.ranges::inplace_merge()
was also affected. #2188 subtract_with_carry_engine
's textual representation is now correct. #2088- Fixed a deadlock in the overload of
condition_variable_any::wait_until
takingstop_token
. #2220 u8streampos
,u16streampos
, andu32streampos
are now declared by<iosfwd>
as required by the Standard after P0482R6 and P1148R0 were accepted. #2223- Fixed ARM64EC compiler errors in
<limits>
. #2306 - Fixed heap corruption in
fstream
when callingputback()
followed byclose()
. #2189 - Fixed
views::reverse
to work properly withranges::reverse_view
lvalues. #2313 - Fixed a bug where the STL's DLL was using Windows Vista's APIs for critical sections and condition variables, instead of the more efficient APIs that were introduced in Windows 7. This was specific to
/MD
(dynamic release) and the STL's GitHub CMake build system; it did not affect the legacy build system that's currently used for official builds of the MSVC toolset. #2314 - Fixed a bug affecting older CPUs where the STL generated the newer
tzcnt
instruction instead of the fallbackbsf
instruction. This affected<bit>
'scountr_zero()
andcountr_one()
,<numeric>
'sgcd()
andlcm()
, andvector<bool>
's optimized implementations offind()
and relational/spaceship operators. #2333 - Fixed minor conformance issues in
basic_string
. These changes were specified by P1148R0 "Cleaning Up[strings]
", which was almost a pure rewording paper without normative impact. Oops! #2222 - Fixed
ranges::find_end()
to return correct values for bidirectional common ranges. #2270 - Fixed compiler errors affecting
ranges::sort()
,ranges::search()
, and other ranges machinery. #2290 - Fixed
array<T, 0>
, allowing it to compile whenT
is not default constructible. #2296 - Fixed
allocator::allocate_at_least()
which was improperly annotated with__declspec(allocator)
. #2328
- Fixed
- Improved performance:
- Optimized
steady_clock::now()
whenQueryPerformanceFrequency()
is exactly 10 MHz, which is very common for modern PCs. #2086 - Improved codegen for x86 atomic loads. #2110
- Optimized the fallback implementation of
popcount()
, which is used when compiler intrinsics are unavailable (and is also used at compile time). #2079 - Slightly improved codegen when
<format>
prints a pointer in hexadecimal. #2097 - Optimized
<ranges>
non-propagating-cache
for trivially destructible types. #2118 - Improved ARM64 codegen for
popcount()
, using compiler intrinsics. #2127 - Extended the
memcpy()
,memmove()
, andmemcmp()
optimizations in various algorithms to handle more types. #2158 - Significantly improved the performance of
bitset::count()
by using the same machinery aspopcount()
. #2201 - Also improved the performance of
std::count()
forvector<bool>
by usingpopcount()
machinery in a more optimizer-friendly way. #2203 weak_ptr
's converting constructors now avoid locking except when necessary to ensure correctness in virtual inheritance scenarios. #2282- For example, converting
weak_ptr<T>
toweak_ptr<const T>
now avoids locking.
- For example, converting
- Removed a duplicated assignment in
filesystem::create_directories()
. #2304 - Optimized
is_permutation()
for reversed sequences. #2043
- Optimized
- Improved throughput:
- Enhanced behavior:
- Changed
numeric_limits<long double>::max_digits10
to handle both 64-bit and 80-bitlong double
, by restoring the original logic that was used before VS 2017 15.8.- Note: 80-bit
long double
remains unsupported by MSVC.
- Note: 80-bit
- C++ headers now emit clear
#error
messages when they're compiled as C. #2148- This applies to both the "C++ library headers" like
<vector>
and the "C++ headers for C library facilities" like<cstdio>
.
- This applies to both the "C++ library headers" like
- Improved the wording of
binary_semaphore
's debug check messages. #2293
- Changed
- Improved documentation:
- Cited LWG-3581 "The range constructor makes
basic_string_view
not trivially move constructible" in our implementation of its proposed resolution. #2175 - Removed comments that were citing GH-489, now that LWG-3530 "
BUILTIN-PTR-MEOW
should not opt the type out of syntactic checks" has been officially resolved by the June 2021 virtual plenary meeting. #2186
- Cited LWG-3581 "The range constructor makes
- Improved test coverage:
- Removed a
constructible_from
test case that was invalidated by recent changes to the Core Language. #2107 - Fixed a test for
next_permutation()
andprev_permutation()
; the algorithms were fine, but the test never worked and was never called. #2137 - Fixed the test harness to handle non-English Visual Studio installations running on Windows with non-UTF-8 encodings. #2145
- Added
/arch:AVX2
to the matrix of compiler options that's used when testing<bit>
. #2150 - Skipped more flaky tests in the legacy
tr1
test suite. #2202 - Fixed flaky tests in the legacy
tr1
test suite that were generating collisions between temporary filenames. #2210 - Fixed test failures on Windows 11. #2265
- Fixed
<chrono>
formatting test failures related to locale-dependent time zone abbreviations. #2231
- Removed a
- Code cleanups:
- Moved a helper
struct
from a central internal header to<optional>
. #2117 - Cleaned up comments and clang-formatting. #2136
- Removed a spurious overload of
operator>>(basic_istream&&, basic_string&)
. This didn't affect correctness, but it was neither necessary nor depicted by the Standard. #2138 - Cleaned up various things, notably simplifying
exception_ptr
's operators for C++20 and emitting a clear error message when compiling<stdatomic.h>
as C. #2140 - Removed unnecessary code in
<cctype>
that was attempting to defend against macroizedisalnum
etc. #2147 - Removed an unnecessary
reinterpret_cast
, and changed somereinterpret_cast
s fromvoid*
toT*
to usestatic_cast
instead. #2096 - Removed an unnecessary definition of our internal macro
_HAS_CXX23
from our central internal headeryvals_core.h
. #2226 - Removed comments that were citing proposed resolutions for LWG issues, now that those issues have been officially resolved by the October 2021 virtual plenary meeting. #2269
- Removed unnecessary
(void)
casts now that MSVC emits fewer spurious warnings about unreferenced parameters. #2280 - Removed compiler bug workarounds. #2327
- Moved a helper
- Infrastructure improvements:
- Updated
_MSVC_STL_UPDATE
. #2183 #2233 #2321