Changelog
Stephan T. Lavavej edited this page Jun 2, 2022
·
968 revisions
Pages 17
Clone this wiki locally
Table of Contents
- VC Redist Lockdown
- Expected in VS 2022 17.4 Preview 1
- Expected in VS 2022 17.3 Preview 3
- Expected in VS 2022 17.3 Preview 2
- VS 2022 17.3 Preview 1 - current preview version, see the VS 2022 Preview Release Notes
- VS 2022 17.2 - current production version, see the VS 2022 Release Notes
- VS 2022 17.1
- VS 2022 17.0
- VS 2019 Changelog
C++20 and C++23 features generally require the /std:c++20 and /std:c++latest compiler options, respectively.
VC Redist Lockdown
To reduce the frequency of required reboots when updating VS (and VS Previews), we "lock down" the Visual C++ Redistributable containing the STL's msvcp140.dll. (Most of the STL is header-only, so most changes are unaffected.) Approximately twice a year, specific VS Previews will be "unlocked", so the VC Redist will contain updated DLLs. These are the unlocked releases:
- VS 2022 17.1 and earlier (everything was unlocked before this process started)
- VS 2022 17.2 Preview 2
- VS 2022 17.4 Preview 2 (expected; not yet certain)
Expected in VS 2022 17.4 Preview 1
- Merged proposed resolutions for LWG issues (not yet accepted for the C++ Working Draft, but we've chosen to implement this speculatively):
- Fixed bugs:
- Improved performance:
- Enhanced behavior:
-
<tuple>is now a core header. #2730
-
- Infrastructure improvements:
Expected in VS 2022 17.3 Preview 3
- Merged C++23 features:
- Fixed bugs:
-
<filesystem>now handles special system files likehiberfil.sys. #2715 -
filesystem::copy_file()now tolerates other processes having opened the source file or the target file for reading or writing (as much as possible, depending on the choice ofcopy_options). #2718 - Fixed the visualizers for
shared_ptr<void>,weak_ptr<void>, andunique_ptr<void, Deleter>. #2706 - Fixed compiler errors in
move_only_functionwhen compiling<functional>in/std:c++latestmode with/Zc:alignedNew-. #2712 - Implemented C++20's removal of the explicit specialization for
allocator<void>. #2726- Note that
allocator<void>is still supported, it just uses the primary template now.
- Note that
- Fixed "unresolved external symbol" linker errors in certain scenarios involving separately compiled third-party libraries. #2734 #2738
- On x64, these errors mentioned
__imp___std_init_once_begin_initializeand__imp___std_init_once_complete. - On x86, these errors mentioned
__imp____std_init_once_begin_initialize@16and__imp____std_init_once_complete@12. - This fixed a regression that was introduced by #2381 in VS 2022 17.2.
- On x64, these errors mentioned
-
- Enhanced behavior:
- C++98's
unexpected()in<exception>was removed by C++17. As with almost all removals, we support an escape hatch to restoreunexpected(), by defining_HAS_UNEXPECTEDto1. However, this escape hatch conflicts with C++23, which is reusing the identifier forunexpected<E>in<expected>. Therefore, the escape hatch is now blocked with an#errorin C++23 mode. #2709 - Added ASan (Address Sanitizer) annotations to
<string>, allowing additional errors to be detected. #2196 -
<ciso646>now emits a warning in C++20 mode, as it was removed in that Standard. #2710 - Temporarily disabled
join_viewfor non-forward_ranges until LWG-3698 is resolved. #2727 -
<random>distributions now have non-constfunction call operators, making it easier to write portable code. #2732
- C++98's
- Improved test coverage:
- Removed
/Zatest coverage. #2714-
/Zais "not recommended" and has been superseded by/permissive-.
-
- Removed
- Infrastructure improvements:
Expected in VS 2022 17.3 Preview 2
- Merged C++23 features:
- Merged partial C++23 features:
- Merged LWG issue resolutions:
-
LWG-3121 #2640
tupleconstructor constraints forUTypes&&...overloads -
LWG-3525 #2639
uses_allocator_construction_argsfails to handle types convertible topair -
LWG-3570 #2418
basic_osyncstream::emitshould be an unformatted output function -
LWG-3571 #2418
flush_emitshould setbadbitif theemitcall fails
-
LWG-3121 #2640
- Merged proposed resolutions for LWG issues (not yet accepted for the C++ Working Draft, but we've chosen to implement this speculatively):
- Fixed bugs:
- Fixed
vector<bool>to properly invalidate iterators during reallocation, which fixes compiler errors withconstexprusage ofvector<bool>. #2441 -
empty_viewrvalues are now consideredborrowed_ranges as required by the Standard. #2576 - Added compiler bug workarounds to
is_convertibleandcommon_reference, socontiguous_iterator<const volatile int*>is nowtrue. #2592 - Added missing constraints to functions that were implied by "Effects: Equivalent to" Standardese:
make_any(),make_optional(),shared_ptr::operator=(),shared_ptr::reset(), andweak_ptr::operator=(). - Fixed
filesystem::path's comparison operators and some other member functions being IF-NDR (ill-formed, no diagnostic required) in C++23 mode. #2457 - Fixed C++20
<chrono>parsing to fail when the input is insufficient to supply the entire format string. #2523- For example, the input
"23:59"is insufficient for the format string"%H:%M:%S".
- For example, the input
- Fixed an out-of-bounds read in
ranges::find()withunreachable_sentinel. #2434 - Added compiler bug workarounds for CUDA (involving
[[nodiscard]] friend) to fix spurious cases of "warning C5240: 'nodiscard': attribute is ignored in this syntactic position". #2622 - Removed
ExecutionPolicyoverloads ofcopy_backward()andmove_backward()that were mistakenly implemented. They don't appear in the Standard because they would be useless. #2627 - Added compiler bug workarounds for Clang (involving the ordering of constrained and unconstrained destructors) to fix compiler errors in
<ranges>machinery. #2630 - Fixed a bug affecting
<future>'s use of<ppltasks.h>in Desktop XAML apps. #2654 - Fixed a bug that prevented C++20
<chrono>from parsing fractional seconds as floating-pointdurations. #2638 - Fixed
<bit>'scountl_zero()returning incorrect results on ARM64 for 8-bit and 16-bit types. #2647 - Added macroization guards to the STL's usage of compiler-specific custom attributes. #2649
- Fixed
get_time()andtime_get's 2-digit year logic. #2666 - Fixed
system_category().message()to behave correctly instead of returning"???"when the user language and system language are different. #2669 - Fixed the ARM64EC implementations of
atomic_thread_fence()andatomic<8-byte type>::store(). #2702 - Fixed compiler errors in
atomic<shared_ptr<T[]>>,atomic<shared_ptr<T[N]>>,atomic<weak_ptr<T[]>>, andatomic<weak_ptr<T[N]>>. #1339 - Added overloads of
<cmath>'slerp()for arithmetic types. #2113 - Fixed
filesystem::directory_entryto work with FAT32 and exFAT. #2373
- Fixed
- Improved performance:
- Optimized
rotl()androtr()in<bit>for 8-bit and 16-bit integers by using compiler intrinsics. #2611 - Optimized the vectorized implementation of
reverse()for 32-bit trivial types. #2383 - Improved
<format>performance when the execution character set isn't self-synchronizing, by caching expensive calls to get codepage info. #2600 - Added vectorized implementations of
find(),count(),ranges::find(), andranges::count(), with speedups ranging from 2.0x to 27.6x (times, not percent). #2434 - Slightly improved the performance of
<charconv>floating-pointfrom_chars(). #2623
- Optimized
- Improved throughput:
- Used
if constexprinstead of tag dispatch, overloads, or specializations in:-
is_permutation(),sample(),rethrow_if_nested(), anddefault_searcher. #2219 -
<map>and<set>'s common machinery. #2287 -
polymorphic_allocator. #2471 -
basic_string_viewandbasic_string'sfind_first_of(),find_last_of(),find_first_not_of(), andfind_last_not_of(). #2479 #2660 -
<regex>. #2484 - Parallel
inclusive_scan()andtransform_inclusive_scan(). #2662 -
scoped_allocator_adaptor'soperator==(). #2677 -
function,move_only_function, andbind(). #2668 -
vector<bool>::insert(). #2694
-
- Replaced tag dispatch with SFINAE in
subtract_with_carry_engine's internal machinery. #2693 - Split
<chrono>into a smaller internal header, improving throughput when other headers need only pre-C++20<chrono>machinery. #2604
- Used
- Enhanced behavior:
- Changed
<deque>to use scope guards instead ofthrow;, making debugging easier when exceptions are thrown. #2308 - Merged an MSVC-specific attribute, allowing the compiler to improve its handling of
constexprdynamic allocation andconstexpr unique_ptr. #2658 - Implemented
<format>grapheme clusterization when determining the width of a string for padding and alignment purposes. This is a "quality of implementation" feature recommended by N4910[format.string.std]/11. #2119 - Changed
<strstream>to deprecate its classes instead of the entire header. #2680
- Changed
- Improved documentation:
- Improved test coverage:
- Dramatically improved the compiler memory consumption and compile time of two
rangesalgorithm tests. #2657
- Dramatically improved the compiler memory consumption and compile time of two
- Code cleanups:
- Removed compiler bug workarounds. #2611
- Various cleanups (described in detail in the PRs, not repeated here). #2595 #2621 #2656 #2673 #2674 #2675 #2676 #2678 #2679 #2686
- Simplified the preprocessor logic in
<stdatomic.h>for non-compiler tools. #2615 - Removed test workarounds now that VCRuntime properly recognizes Clang's
/std:c++20and/std:c++latestmodes. #2637
- Infrastructure improvements:
- Fixed the build system to avoid relinking any DLLs when rerunning CMake and Ninja with no other changes. #2606
- Added
formatandvalidatetargets to CMake, so it can run clang-format in parallel, and improved how Azure Pipelines runs the Code Format Validation check. #2671 #2697 - Updated dependencies. #2611 #2651
- Updated build compiler to VS 2022 17.2 Preview 3 (now required).
- Updated to Windows 11 SDK 22000.
- Updated Python to 3.10.4.
- Updated
_MSVC_STL_UPDATE. #2634 #2696
VS 2022 17.3 Preview 1
- No changes.
VS 2022 17.2
- Merged C++20 Defect Reports:
- Merged C++23 features:
- Merged LWG issue resolutions:
-
LWG-2762 #2376
unique_ptroperator*()should benoexcept -
LWG-2774 #2098
std::functionconstruction vs assignment -
LWG-3146 #2409 Excessive unwrapping in
std::ref/cref -
LWG-3392 #2421
ranges::distance()cannot be used on a move-only iterator with a sized sentinel -
LWG-3470 #2414
convertible-to-non-slicingseems to reject valid case -
LWG-3471 #2567
polymorphic_allocator::allocatedoes not satisfy Cpp17Allocator requirements -
LWG-3480 #2340
directory_iteratorandrecursive_directory_iteratorare not C++20 ranges -
LWG-3519 #2208 Incomplete synopses for
<random>classes -
LWG-3543 #2424 Definition of when
counted_iterators refer to the same sequence isn't quite right -
LWG-3557 #2406 The
static_castexpression inconvertible_tohas the wrong operand -
LWG-3563 #2426
keys_viewexample is broken -
LWG-3574 #2410
common_iteratorshould be completelyconstexpr-able -
LWG-3580 #2417
iota_view'siterator's binaryoperator+should be improved -
LWG-3589 #2425 The
constlvalue reference overload ofgetforsubrangedoes not constrainIto becopyablewhenN == 0 -
LWG-3590 #2404
split_view::base() const &is overconstrained -
LWG-3591 #2411
lazy_split_view<input_view>::inner-iterator::base() &&invalidates outer iterators -
LWG-3592 #2411
lazy_split_viewneeds to check the simpleness ofPattern -
LWG-3593 #2448 Several iterators'
base() const &andlazy_split_view::outer-iterator::value_type::end()missingnoexcept -
LWG-3595 #2410 Exposition-only classes
proxyandpostfix-proxyforcommon_iteratorshould be fullyconstexpr -
LWG-3598 #2560
system_category().default_error_condition(0)is underspecified -
LWG-3610 #2542
iota_view::sizesometimes rejects integer-class types -
LWG-3612 #2586 Inconsistent pointer alignment in
std::format -
LWG-3618 #2566 Unnecessary
iter_movefortransform_view::iterator -
LWG-3621 #2543 Remove feature-test macro
__cpp_lib_monadic_optional -
LWG-3648 #2587
formatshould not printboolwith'c' -
LWG-3654 #2528
basic_format_context::arg(size_t)should benoexcept -
LWG-3657 #2564
std::hash<std::filesystem::path>is not enabled -
LWG-3660 #2549
iterator_traits<common_iterator>::pointershould conform to[iterator.traits] -
LWG-3661 #2544
constinit atomic<shared_ptr<T>> a(nullptr);should work
-
LWG-2762 #2376
- Merged proposed resolutions for LWG issues (not yet accepted for the C++ Working Draft, but we've chosen to implement this speculatively):
- Fixed bugs:
- Fixed Clang compiler errors when using
ranges::join_view. #2352 - Fixed several runtime correctness bugs in
std::string. #2305 - Fixed a memory leak affecting a specific scenario in P0408R7 Efficient Access To
basic_stringbuf's Buffer. #2361 - Each call to
ranges::clampnow correctly performs at most three projections. #1898 - The STL no longer rejects Clang in CUDA mode, nor the
cl /showIncludes /D__CUDACC__ ...command used by CUDA's msbuild integration to gather dependencies. #2075 - Fixed
allocator::is_always_equalto be deprecated, not removed, in C++20 mode. (It was deprecated by LWG-3170.) #2423 - Fixed
begin()/end()crashing for emptyvalarrays, which also affected range-based for-loops. #2435 - Fixed regression in
ranges::distance(from LWG-3392 which brokeranges::distance(some_array, s)) by speculatively implementing LWG-3664. #2522 - Fixed
basic_string::resize_and_overwrite()to no longer emit "warning C4018: signed/unsigned mismatch" when given certain user-defined function objects. #2525 - Increased
__cpp_lib_conceptsto its final value for C++20,202002L. #2559- It should have been updated in VS 2019 16.6 when P1964R2 "Replacing
booleanWithboolean-testable" was implemented by #565. The presence of that release (or any later release) can be detected by inspecting our implementation-specific macro_MSVC_STL_UPDATE. Coincidentally, the value of_MSVC_STL_UPDATEfor VS 2019 16.6 was also202002L.
- It should have been updated in VS 2019 16.6 when P1964R2 "Replacing
- Fixed numerous tiny bugs discovered by the
libcxxtest suite. #2499 - Fixed a bug in
<format>that sporadically caused incorrect output when formatting floating-point values inhexorscientificnotation with extremely large precisions. #2569 - Fixed a bug in
<charconv>from_chars()floattiebreaking that produced incorrect results. This affected decimal strings that were at the exact midpoint of consecutivefloatvalues, within a narrow range (the smallest and largest affected values were"32768.009765625"and"131071.98828125"), where the tiebreaker rule wanted to round to "even" and "even" happened to be "down", but the implementation incorrectly rounded "up". (doublewas unaffected.) #2366 -
promise<T>now compiles when!is_default_constructible_v<T>. #2568 - Moving from an
optional<const T>now behaves like moving from aconst T: it selectsT's copy constructor. #2460 - Fixed a bug in
<format>that incorrectly acceptedvolatilearguments; the Standard currently says that they should be rejected. #2579
- Fixed Clang compiler errors when using
- Improved performance:
- Optimized
rotl()androtr()in<bit>for 32-bit and 64-bit integers by using compiler intrinsics. #2369 -
reverse_copy()'s vectorized implementation is now activated (for eligible types) in all Standard modes. Previously, only the C++14/17 modes activated this optimization; C++20/23 modes unintentionally used the plain implementation (correct but slower). #2416 - Improved codegen for
gcd()andlcm(). #2343 - Improved
<format>performance when the execution character set is self-synchronizing. For example, code page 1252 "ANSI Latin 1; Western European (Windows)" activates this optimization. The/utf-8compiler option also activates this optimization. #2493 - Improved codegen for
generate_canonical. #2498
- Optimized
- Improved throughput:
- Enhanced behavior:
- Fixed new warnings emitted by Clang 13:
-Wdeprecated-copy(in product and test code) and-Wunused-but-set-variable(in test code only). #2266 - Added ASan (Address Sanitizer) annotations to
<vector>, allowing additional errors to be detected. #2071 #2420 #2464 #2508 - Added a debug assertion to
allocator::deallocate(); passing a null pointer with a non-zero size is an error. #2412 - For supply chain security, replaced checked-in OBJ files (generated by an internal tool
aliasobj) with the linker's/ALTERNATENAMEoption (which is strictly more reproducible, although not officially documented). #2381- In certain scenarios involving separately compiled third-party libraries, this can cause "unresolved external symbol" linker errors. See issue #2655 for an explanation and workarounds.
- Fixed new warnings emitted by Clang 13:
- Improved documentation:
- Improved test coverage:
- Code cleanups:
- Removed compiler bug workarounds. #2338 #2351 #2357 #2474 #2496
- Updated test code to directly pass a format string to
printf(), allowing the compiler to check it. #2346 - Cleaned up clang-formatting. #2356
- Changed the
<charconv>test headers to use include guards, for closer alignment with libc++. #2372 - Improved the clarity of vectorized algorithm implementations by replacing the magic numbers
27and78. #2377 - Improved consistency by always saying
friend constexprinstead of the reverse order. #2419 - Simplified
<ratio>'s implementation by usingconstexprfunctions instead of template metaprogramming. #2450 - Simplified an internal function for opening files. #2095
- Infrastructure improvements:
- Updated dependencies. #2474 #2496 #2514
- Updated build compiler to VS 2022 17.1 Preview 5 (now required).
- Updated Clang to 13.0.0 (now required).
- Updated CMake to 3.22 (now required).
- Updated Python to 3.10.2.
- Added scripts to set
INCLUDE,LIB, andPATHafter building the repo. #2578 - Azure Pipelines now uploads test logs as artifacts, making it easier to investigate test failures when lengthy command lines, compiler output, or runtime output are truncated in the web UI. #2575
- Updated dependencies. #2474 #2496 #2514
- Updated
_MSVC_STL_UPDATE. #2374 #2455 #2519 #2602
VS 2022 17.1
- 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:c11and/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
volatilePointers -
P1272R4 #2235
byteswap() -
P1425R4 #1994 Iterator Pair Constructors For
stackAndqueue - P1518R2 #2032 Stop Overconstraining Allocators In Container Deduction Guides
-
P1659R3 #1997
ranges::starts_with,ranges::ends_with -
P2136R3 #2019
invoke_r() -
P2251R1 #2259 Require
spanAndbasic_string_viewTo Be Trivially Copyable -
P2401R0 #2263 Conditional
noexceptForexchange()
-
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_moveanditer_swapare inconsistent fortransform_view::iterator -
LWG-3522 #1994 Missing requirement on
InputIteratortemplate parameter forpriority_queueconstructors -
LWG-3527 #2194
uses_allocator_construction_argshandles rvalue pairs of rvalue references incorrectly -
LWG-3528 #2160
make_from_tuplecan perform (the equivalent of) a C-style cast -
LWG-3536 #2037 Should
chrono::from_stream()assign zero todurationfor failure? -
LWG-3546 #1991
common_iterator'spostfix-proxyis not quite right -
LWG-3549 #2198
view_interfaceis overspecified to derive fromview_base -
LWG-3554 #2261
chrono::parseneedsconst 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_iterators of different types for equality. #2066 - Attempting to actually call
declval()now emits astatic_assertciting 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_types. #2121 - Restored our guarantee beyond the Standard that
string_viewis trivially move constructible. #2128 - Fixed a bug where
vectorandstringwould terminate vianoexceptinstead of throwinglength_erroras desired when asize_twould 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
constexprvectors 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_untiltakingstop_token. #2220 -
u8streampos,u16streampos, andu32streamposare 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
fstreamwhen callingputback()followed byclose(). #2189 - Fixed
views::reverseto work properly withranges::reverse_viewlvalues. #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
tzcntinstruction instead of the fallbackbsfinstruction. 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 whenTis 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-cachefor 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_digits10to 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 doubleremains unsupported by MSVC.
-
Note: 80-bit
- C++ headers now emit clear
#errormessages 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_viewnot trivially move constructible" in our implementation of its proposed resolution. #2175 - Removed comments that were citing GH-489, now that LWG-3530 "
BUILTIN-PTR-MEOWshould 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_fromtest 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:AVX2to the matrix of compiler options that's used when testing<bit>. #2150 - Skipped more flaky tests in the legacy
tr1test suite. #2202 - Fixed flaky tests in the legacy
tr1test 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
structfrom 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 macroizedisalnumetc. #2147 - Removed an unnecessary
reinterpret_cast, and changed somereinterpret_casts fromvoid*toT*to usestatic_castinstead. #2096 - Removed an unnecessary definition of our internal macro
_HAS_CXX23from 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
VS 2022 17.0
- Merged C++20 Defect Reports:
- Enabled C++20 features for Clang: #2064
- Merged C++23 features:
- P0401R6 #2036 Providing Size Feedback In The Allocator Interface
-
P1048R1 #1950
is_scoped_enum -
P1132R7 #1998
out_ptr(),inout_ptr() -
P1679R3 #1478
contains()Forbasic_string/basic_string_view -
P1682R3 #1828
to_underlying()For Enumerations -
P1951R1 #2009 Default Template Arguments For
pair's Forwarding Constructor -
P1989R2 #2000 Range Constructor For
string_view -
P2162R2 #2006 Inheriting From
variant -
P2166R1 #1995 Prohibiting
basic_stringAndbasic_string_viewConstruction Fromnullptr- This is a common source-breaking change - code that previously had undefined behavior at runtime will now be rejected with compiler errors.
- P2186R2 #2010 Removing Garbage Collection Support
- Merged LWG issue resolutions:
-
LWG-3430 #1968
std::fstream& co. should be constructible fromstring_view - LWG-3494 #1877 Allow ranges to be conditionally borrowed
-
LWG-3502 #1878
elements_viewshould not be allowed to return dangling references - LWG-3518 #2080 Exception requirements on char trait operations unclear
-
LWG-3533 #1993 Make
base() const &consistent across iterator wrappers that supportinput_iterators -
LWG-3541 #1992
indirectly_readable_traitsshould be SFINAE-friendly for all types -
LWG-3548 #2007
shared_ptrconstruction fromunique_ptrshould move (not copy) the deleter -
LWG-3553 #1990 Useless constraint in
split_view::outer-iterator::value_type::begin() -
LWG-3555 #1989
{transform,elements}_view::iterator::iterator_conceptshould considerconst-qualification of the underlying range
-
LWG-3430 #1968
- Merged partial LWG issue resolutions:
- Fixed bugs:
- Fixed
time_put::do_putto avoid crashing when the invalid parameter handler has been changed to not end execution. #1563 - Fixed a compiler error in
ranges::take_view. #1844 - Fixed improper partitioning of forward ranges in the parallel algorithms. #1753
- Fixed an unintentionally exported symbol in the import library. #1927
- Fixed a bug in which
ranges::unique_copywould fail to compile with a non-input output iterator. #1933 - Fixed a compiler error when calling
format_to()in a specialization offormatter(see #1961 for an example). #1874 - Fixed compiler errors when calling
views::dropandviews::takewith types that aren't integers, but are convertible to integers (e.g.integral_constant). #1958 - Fixed a compiler error when calling
constexprvector::emplace(position, args...). #1962 - Fixed
jthreadto providenative_handle(). #1966 - Fixed
filesystem::remove()to delete read-only files, as required by the Standard. #1559 - Fixed
mersenne_twister_engine: #1631- Fixed the seeding algorithm to follow N4892 [rand.eng.mers]/8, avoiding an all-zero state. (This is a runtime special case.)
- Fixed the engine's behavior when
m == norn == 1. (This is a compile-time special case, which doesn't affectmt19937andmt19937_64at all.) - Fixed
operator<<()to avoid printing a trailing space after the engine's textual representation.
- Fixed
<chrono>to adjust for leap seconds when formattingfile_time. #1879 - Fixed
chrono::from_stream()to allow a year and a day-of-year to be parsed to atime_point. #1940 - Fixed
filesystem::u8path()to acceptchar8_tsources. #1943 - Fixed
<chrono>to parse subseconds fortime_points. #1987- Also fixed the parsing of
local_timewith a UTC offset.
- Also fixed the parsing of
- Fixed
<chrono>formatting to correctly estimate string widths (see N4892 [format.string.std]/9). #2017 - Fixed a major regression in the
_ITERATOR_DEBUG_LEVEL == 2machinery, where a multithreaded program in debug mode could crash when one thread is modifying a container and another thread is destroying iterators. #2060- This regression affected all Standard modes (C++14/17/20/23) and was introduced by #1546 in VS 2019 16.10.
- Fixed in both VS 2019 16.11.4 and VS 2022 17.0.
- Fixed a compiler error in
pmr::map<K, pair<A, B>>::operator[]. #2023 - Fixed compiler errors in
basic_string'sgetline()andoperator>>()caused by the source-breaking change C++23 P2266R1 "Simpler Implicit Move", first implemented in Clang 13. #2025 -
bit_ceil()now enforces its precondition duringconstexprevaluation, as required by the Standard. #2041 -
clogis no longer tied tocout, and similarly forwclogandwcout, following the Standard. #2056 - In
<ranges>, whenfilter_view,drop_view,drop_while_view, andreverse_viewstore a cached position into an underlying view, they now properly invalidate that cached position when the underlying view is moved from. #1931
- Fixed
- Improved performance:
- Slightly improved debug codegen for
vector<bool>,basic_string, andmap/multimap/set/multiset'sempty()member functions. #1836 - Fixed bloated codegen for
<format>. #1874 - Dramatically improved the performance of
std::find()andstd::count()forvector<bool>, with measured speedups between 19x and 26x (times, not percent). #1131 - Extended our
memcmp/memcpy/memchroptimizations to ranges with contiguous iterators and unreachable sentinels. #1810 -
<format>now detects when it's writing to aback_insert_iteratorfor abasic_stringor avector, and performs a faster call toinsert()at theend()of the container. #1894 -
std::bytenow activates the "trivially swappable" optimization inreverse()andvariant::swap(), so it'll have the same performance asunsigned char. #2044 - Extended the vectorization optimization in
std::swap_ranges()toranges::swap_ranges(), and enhanced it to work for arbitrary contiguous iterators. #2048 - Reduced debug codegen size; an internal assertion macro was emitting completely unused, potentially long strings for function names. #2054
- Slightly improved debug codegen for
- Improved throughput:
-
<format>and<chrono>now avoid including<array>. #2031
-
- Enhanced behavior:
- Added a visualizer for
source_location. #1837 - Added
[[nodiscard]]to thestoi()family of functions in<string>and to various functions in<locale>(collatemember functions,has_facet(), and theisalnum()andtolower()families). #1809 - Added a debug mode precondition check to
forward_list::splice_after(). #2057 - Added visualizers for
bind_front(),u8string(and its iterators),default_sentinel_t,unreachable_sentinel_t,ranges::empty_view,ranges::single_view,ranges::iota_view(and its iterator/sentinel),ranges::ref_view,thread,thread::id,jthread, andfilesystem::path. #1856
- Added a visualizer for
- Improved test coverage:
- Added test coverage for our implementation-specific guarantees that
spanandbasic_string_vieware trivially copyable; P2251 may eventually Standardize these guarantees. #2015 - Fixed the ranges test machinery to properly specialize
std::basic_common_reference; it was unintentionally relying on identical bugs in MSVC and Clang, but EDG correctly diagnosed that the code was non-Standard. #2013 - Fixed a test (for the
abs()overloads in<cmath>and<cstdlib>) that unintentionally hadn't been running in our new GitHub test harness. #2070
- Added test coverage for our implementation-specific guarantees that
- Code cleanups:
- Removed compiler bug workarounds. #1759 #1778 #1920
- Removed unnecessary C casts. #1843
- The STL now uses Standard
_Pragmainstead of non-Standard__pragma(when possible) to internally suppress warnings. #1342 -
<format>now uses_First/_Lastparameter names (instead of_Begin/_End) to be consistent with the rest of the STL. (The connotations are that first/last refers to an arbitrary range that might be a subrange, while begin/end refers to an entire container/view.) #1951 - Removed comments that were citing proposed resolutions for LWG issues, now that those issues have been officially resolved by the June 2021 virtual plenary meeting. #1967
- Improved
vector's implementation, also usingif constexprto simplify code. #1771 - Simplified
<format>'s implementation of type-erased argument storage. #1907 - Filed LWG-3566 "Constraint recursion for
operator<=>(optional<T>, U)" and updated our implementation's comment accordingly. #2011 - Simplified the backwards loop in
char_traits::move(). #2055 - Marked all overriding functions with
override, and removed redundantvirtualkeywords. #2069 - REMOVED THE "SHOUTY COMMENT BANNERS" LIKE
// CLASS TEMPLATE vector; SEE #306 FOR THE RATIONALE. #2074 - Removed an unnecessary check for self-assignment in the compile-time implementation of
char_traits::move(). #2083
- Infrastructure improvements:
- Build system improvements:
- The STL is now built with MSVC's
/ZH:SHA_256switch to improve supply chain integrity. #1829
- The STL is now built with MSVC's
- Updated
_MSVC_STL_UPDATE. Also updated_MSVC_STL_VERSIONto143for the VS 2022 release series. #1897 #1955 #2035 #2091
Older Versions
See the VS 2019 Changelog.

