-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Changelog
Stephan T. Lavavej edited this page Oct 10, 2025
·
2534 revisions
- MSVC Build Tools 14.51 Insiders - see the VS 2026 Insiders Release Notes
- MSVC Build Tools 14.50 Insiders
- VS 2022 17.14 - latest production version, see the VS 2022 Release Notes
- VS 2022 17.13
- VS 2022 17.12
- VS 2022 Changelog
- VS 2019 Changelog
C++23 features generally require the /std:c++23preview or /std:c++latest compiler options.
- Removed non-Standard features:
- Merged C++23 features:
- Merged partial C++20 features:
-
P0466R5 Layout-Compatibility And Pointer-Interconvertibility Traits
- This feature was fully implemented for MSVC by #1575 in VS 2019 16.10.
-
is_layout_compatibleandis_pointer_interconvertible_base_ofare now implemented for Clang, as the necessary compiler builtins recently became available. #5621 -
is_pointer_interconvertible_with_class()andis_corresponding_member()remain to be implemented for Clang, as the necessary compiler builtins are not yet available.
-
P0466R5 Layout-Compatibility And Pointer-Interconvertibility Traits
- Fixed bugs:
- Fixed
basic_string::resize_and_overwrite()to require the given operation to return an integer-like type. #5695 - Added a compiler bug workaround for Clang x86, fixing 64-bit
atomicbehavior. #5708 - Fixed
<regex>bugs when parsing repetitions in extremely unusual cases. #5716 - Fixed the
vector<bool>optimization forcopy()to avoid a forbidden negative shift in a specific scenario. #5726 - Fixed
independent_bits_engineto avoid forbidden full shifts in specific scenarios. #5740 - Fixed compiler errors in
vectorwhen programs are taking advantage of our non-Standard legacy support for mismatched allocator types (i.e.vector<T, MyAlloc<U>>, which is forbidden by the Standard). #5729- This fixed a regression that was introduced by #4977 in VS 2022 17.13.
- Fixed compiler warnings and errors in
basic_stringfor allocators with unusualsize_types. #5562 - Fixed a crash in the vectorized implementations of
wstring::find_first_of()andwstring::find_last_of()that was specific to searching for certain combinations of characters inside and outside the [0, 255] range. #5758- This fixed a regression that was introduced by #5029 in VS 2022 17.14.
- Fixed
std::pow(dbl, 2)to returndbl * dblas a special case, working around an accuracy issue in UCRT::pow()that affects ~0.04% ofdoublevalues. #5771- This fixed a regression that was introduced by #903 in VS 2019 16.8.
- For example, the square of 0.96211481342217475276612503876094706356525421142578125 (hexfloat
0x1.ec9a50154a6f9p-1) is mathematically 0.9256649142063861358000347706773514725967013405547974870554600612150564220570458928705193102359771728515625, which cannot be exactly represented as a 64-bitdouble. UCRT::pow(x, 2.0)returns 0.92566491420638608023097049226635135710239410400390625 (hexfloat0x1.d9f0c06b2463dp-1), butx * xreturns 0.9256649142063861912532729547820053994655609130859375 (hexfloat0x1.d9f0c06b2463ep-1). Thedoublevalue ofx * xis slightly closer to the mathematically exact square, therefore it is correctly rounded and should be returned.
- Fixed
- Improved performance:
- Improved
<ranges>performance by adding an optimized implementation of divide-ceiling for 128-bit integers. #5637 - Updated
<complex>to use Fused Multiply-Add (FMA) intrinsics for Clang. #5721 - Optimized
sample(),shuffle(),ranges::sample, andranges::shuffleby using Daniel Lemire's algorithm Fast Random Integer Generation in an Interval.- This was originally implemented for
uniform_int_distributionby #3012 in VS 2022 17.5.
- This was originally implemented for
- Improved the vectorized implementations of:
- Optimized
any::swap()by avoiding unnecessary copies. #5710
- Improved
- Enhanced behavior:
- Implemented compiler warnings when the Standard forbids user-defined specializations of Standard Library templates. #5536
- This uses the recently-implemented attributes
[[msvc::no_specializations("reason")]]and[[clang::no_specializations("reason")]].
- This uses the recently-implemented attributes
- Silenced spurious static analysis warnings in
vector<bool>::max_size(). #5707 - Silenced CodeQL warnings. #5711
- Prepared
<regex>for another round of improvements to reduce stack space consumption by processing things non-recursively: #5703 - Improved
<random>'s engines and distributions to no longer derive from their non-Standard TR1 predecessors. #5712 - Updated
tupleto apply the resolution of LWG-3677 "Is a cv-qualifiedpairspecially handled in uses-allocator construction?". #5669- This was originally implemented for
pairby #3396 in VS 2022 17.7.
- This was originally implemented for
- Implemented compiler warnings when the Standard forbids user-defined specializations of Standard Library templates. #5536
- Improved test coverage:
- Enabled ARM64EC test coverage for Clang. #5717
- Removed
/analyzefrom the libcxx test suite to reduce compiler memory consumption, as we have sufficient test coverage elsewhere. #5724 - Fixed bogus tests for the most triumphant type trait functions
is_corresponding_member()andis_pointer_interconvertible_with_class(). #5730 #5737 - Added test coverage for
constexprvector<bool>. #5728 - Reactivated test coverage using Clang's Undefined Behavior Sanitizer (UBSan). #5746
- Improved test coverage for
<filesystem>. #5749
- Code cleanups:
- Reduced code duplication for
<bit>machinery. #5696 - Removed compiler bug workarounds. #5717
- Fixed a typo. #5713
- Reduced code duplication for
vector<bool>benchmarks. #5732 #5742 - Cleaned up the separately compiled implementations of vectorized algorithms:
- Added
templateandtypenamekeywords as required by the Standard. #5743 - Removed unused functions. #5744
- Avoided unnecessary unaligned memory accesses in
bitset's constructors from strings. #5759 - Avoided unnecessary unaligned memory accesses in
swap_ranges(),ranges::swap_ranges,rotate(), andranges::rotate. #5760 - Removed a bogus assumption (which was fortunately harmless). #5761
- Added
- Various cleanups (described in detail in the PRs, not repeated here). #5753
- Reduced code duplication for
- Infrastructure improvements:
- Build system improvements:
- Added compiler and linker options to the GitHub CMake build system, fixing divergence with the MSVC-internal MSBuild build system. #5652
- The STL now clearly rejects attempts to build a preset or test a build whose architecture doesn't match the Developer Command Prompt (which is x86-native, but very slightly different from the x86 Native Tools Command Prompt where enforcement was previously validated). #5731
- Updated
_MSVC_STL_UPDATE. #5709 #5752
This shipped in VS 2026 18.0.
- The STL no longer supports targeting Windows 7 / Server 2008 R2, Windows 8 / Server 2012, and Windows 8.1 / Server 2012 R2:
- Improved the performance of
system_clock::now()andatomic::wait()by directly calling APIs that were added in Windows 8. #5432 #5496 - Improved the performance of STL Hardening by using the MSVC
__fastfailintrinsic that was added in Windows 8, and the Clang__builtin_verbose_trapintrinsic. #5433 #5458 - Simplified the
<filesystem>implementation by unconditionally calling APIs that were added in Windows 8. #5434 - Windows 10 / Server 2016 are our minimum supported operating systems. #5510
- Improved the performance of
- The STL no longer supports targeting 32-bit ARM. #5594
- Merged C++26 features:
- Merged partial C++26 features:
- Merged LWG issue resolutions:
-
LWG-2503 #5535
multilineoption should be added tosyntax_option_type- For us, this is a
regexbehavioral change, so we added an escape hatch. By default, we define_REGEX_LEGACY_MULTILINE_MODEto0, which requests Standard behavior:- For ECMAScript, matching is non-multiline by default, but
regex_constants::multilinecan be requested. - For POSIX grammars, matching is non-multiline, and
regex_constants::multilineis ignored; see N5008 [tab:re.synopt].
- For ECMAScript, matching is non-multiline by default, but
- Defining
_REGEX_LEGACY_MULTILINE_MODEto1requests legacy behavior:- For all grammars, matching is multiline, and
regex_constants::multilineis redundant.
- For all grammars, matching is multiline, and
- For us, this is a
-
LWG-4186 #5444
regex_traits::transform_primarymistakenly detectstypeidof a function -
LWG-4222 #5602
expectedconstructor from a single value missing a constraint -
LWG-4242 #5603
ranges::distancedoes not work with volatile iterators
-
LWG-2503 #5535
- 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
regex's behavior:- For the
basicandgrepgrammars to properly handle^caret characters. #5165 - For the
basicandgrepgrammars to properly handle$dollar characters. #5362 - For the
basicandgrepgrammars to make backreferences to unmatched capture groups fail to match anything, instead of matching the empty string"". #5376 - For the
basicandgrepgrammars to properly handle backslashes inside square-bracket character classes. #5523 - For POSIX grammars to allow a
]right square bracket at the beginning of a character range. #5364 - For POSIX grammars to avoid resetting matched capture groups. #5377
- For the
ECMAScriptgrammar's(?!pattern)negative lookahead assertions to make capture groups within them always match nothing after the assertions succeed. #5366 - For the
ECMAScriptgrammar's\bword boundary assertion to not match the empty string""(and inversely for the\Bnegative word boundary assertion). #5375 - For the
ECMAScriptgrammar's\cescapes to require the following ControlLetter to be an ASCII alphabetic character. #5524- That is, only
\cathrough\czand\cAthrough\cZare allowed.
- That is, only
- For the
ECMAScriptgrammar to reset all capture groups to "unmatched" at the start of each repetition of a loop. #5456 - For the
ECMAScriptgrammar to reject bogus groups by throwing aregex_errorwith the coderegex_constants::error_badrepeat, removing the non-Standard coderegex_constants::error_syntaxthat was previously used. #5542- That is, only non-capture groups
(?:meow)and positive/negative lookahead assertions(?=meow)/(?!meow)are allowed; other characters following(?are bogus. Notably, the C++ Standard doesn't support the lookbehind assertions(?<=meow)/(?<!meow)that were added in later versions of ECMAScript.
- That is, only non-capture groups
- For the
ECMAScript,basic,grep, andawkgrammars to properly handle escape sequences. #5380- POSIX grammars now accept
\]as an identity escape for a right square bracket. #5399
- POSIX grammars now accept
- For capture groups to follow ECMAScript's depth-first and POSIX's leftmost-longest matching rules. #5218
- Removed unnecessary code for POSIX's leftmost-longest rule, reducing stack space consumption. #5405
- For empty matches to follow ECMAScript's and POSIX's slightly different rules. #5494
- For negated character class escapes (
\Dfor non-digits,\Sfor non-whitespace,\Wfor non-words) inside square-bracket character classes when matching against Unicode characters. #5403 #5487 - For combinations of character class escapes inside square-bracket character classes (like
[\w\s]for words and whitespace) when matching against Unicode characters. #5438 - For character ranges with
regex_constants::collateto follow the locale's collation order. #5238 - For collating symbols and equivalence classes. #5392 #5444
- For small character ranges containing U+00FF and U+0100. #5437
- For
regex_constants::icaseandregex_constants::collateto translate each character exactly once before any comparisons. #5553 - For extremely unusual user-defined character types. #5592 #5675
- To avoid requiring non-Standard typedefs in custom regex traits classes. #5671
- For the
- Fixed
collate<wchar_t>to follow the locale's collation order when compiling with/Zc:wchar_t-(makingwchar_ta non-Standard typedef forunsigned short) and linking to the STL dynamically (with/MDor/MDd). #5361 - Fixed how
collate::do_transform()handles wrongly encoded input. #5431 - Fixed
collate::do_hash()to return equal hashes for strings that collate as equivalent. #5469 - Fixed
ranges::enable_viewto correctly reportfalseforranges::view_interfaceitself. #5369 #5407 - Fixed
<filesystem>status functions to avoid failing for invalid paths when the current directory is a network path. #5381 - Fixed compiler errors in
repeat_view's piecewise constructor for certain scenarios. #5388 - Fixed compiler errors in
constexprcopy()forvector<bool>. #5347- This fixed a regression that was introduced by #3353 in VS 2022 17.9.
- Fixed the
barrierconstructor's exception specification to be conditionally "strengthened", instead of unconditionally. #5398 - Fixed heap-use-after-free bugs in our undocumented/quasi-supported
_HAS_EXCEPTIONS=0mode when constructingsystem_error,chrono::ambiguous_local_time, andchrono::nonexistent_local_time. #5406 - Fixed compiler errors when passing
volatileranges tobasic_string'sfrom_rangeconstructor andappend_range(),assign_range(),insert_range(), andreplace_with_range()member functions. #5409 - Fixed
nth_element()andranges::nth_elementto have worst-case linear complexity, instead of quadratic. #5100 - Fixed compiler errors when passing iterators with unusual integer-class difference types to vectorized algorithms. #5471
- Fixed
destroy(),destroy_at(),destroy_n(),ranges::destroy,ranges::destroy_at, andranges::destroy_nto destroy objects during constant evaluation even when they're trivially destructible. #5449 - Fixed
num_get::do_get()forboolto properly handle bad digit groupings. #5476 - Fixed
thread::hardware_concurrency()to correctly report the total number of logical processors when more than 64 are available, for both single-socket and multi-socket machines. #5459 - Fixed
<mdspan>'slayout_stride::mapping<E>::is_exhaustive()to correctly handle unusual extents. #5477 - Fixed
reverse_copy()andranges::reverse_copybeing improperly vectorized forpair<T&, U&>on 32-bit targets (where suchpairs are 8 bytes). #5528- This fixed a regression that was introduced by #804 in VS 2019 16.8.
- Fixed
chrono::zoned_timeto provide a fallback time zone abbreviation (of the form"-05"or"+0530") when the system's code page can't represent the localized abbreviation that would normally be returned. #5558 - Fixed
counting_semaphore::try_acquire_for()to consistently usesteady_clock. #5575 - Silenced a static analysis warning C6510 emitted by the extremely unusual scenario of
basic_string<char_like_struct>. #5563 - Fixed compiler errors involving incomplete types in
<chrono>. #5629 - Fixed occurrences of Clang 21's new
-Wcharacter-conversionwarning in<locale>by avoiding implicit conversions betweencharN_ttypes. #5653 - Fixed integer overflow in
stable_sort()andranges::stable_sortwhen sorting huge inputs on x86. #5677- This affected 32-bit architectures with over a billion 1-byte elements. 64-bit architectures were immune.
- Fixed
filesystem::temp_directory_path(error_code&)to return an emptyfilesystem::pathwhen an error is encountered. #5570
- Fixed
- Improved performance:
- Improved performance for
regexmatching:- When a
regexstarts with a?question mark quantifier or several alternatives, by avoiding quadratic complexity. #5457 - When a
regexstarts with a+plus quantifier (or{min,}or{min,max}quantifiers requiring at least 1 repetition). #5509 - When a
regexcontains no capture groups, by avoiding unnecessary allocations. #5518 - For all
regexpatterns, by not generating unnecessary "if" nodes with a single branch. #5539 - When a
regexstarts with positive/negative word boundary assertions\b/\Band lookahead assertions(?=meow)/(?!meow). #5576 - By calling
std::search()internally. #5586 - By avoiding unnecessary work in
regex_constants::collatemode. #5672
- When a
- Started using
[[msvc::no_unique_address]]as a space optimization in several C++23 components. #4960 - Added vectorized implementations of:
-
basic_string::find_first_not_of()andbasic_string::find_last_not_of()for one character. #5102 -
basic_string::find_first_not_of()andbasic_string::find_last_not_of()for multiple characters. #5206 -
adjacent_find()andranges::adjacent_find. #5331 -
unique()andranges::unique. #5092 #5363 -
search_n()andranges::search_nfor small values of n. #5352 -
remove_copy(),ranges::remove_copy,unique_copy(), andranges::unique_copy. #5355 -
is_sorted_until()andranges::is_sorted_until. #5420 #5540 -
search(),ranges::search,default_searcher,find_end(), andranges::find_end, for 4-byte and 8-byte elements. #5484 #5519- They were vectorized for 1-byte and 2-byte elements in VS 2022 17.13.
-
rotate()andranges::rotate. #5502 #5525
-
- Improved the vectorized implementations of:
- Improved the performance of
ranges::findfor 2-byte elements on ARM64, matchingfind()'s behavior. #5628 - Used Clang's builtin
__is_trivially_equality_comparableto improve the performance ofequal(),ranges::equal, and many vectorized algorithms for more types. #5527 - Optimized
search_n()andranges::search_nfor n=1 to internally callfind()andranges::find. #5346 - Improved codegen for
has_single_bit(), especially whenpopcount()intrinsics are unconditionally available. #5367 #5534- For example, x86/x64 with
/arch:AVXand ARM64 can unconditionally usepopcount()intrinsics.
- For example, x86/x64 with
- Optimized
poisson_distribution's constructor by avoiding unnecessary work. #5411 - Implemented an exponential speedup (yes, literally) for
minstd_randandminstd_rand0'sdiscard()member function. #5412 - Improved
linear_congruential_engineperformance by using our modern internal implementation of 128-bit integers. #5436 #5473 - Significantly improved performance for
chrono::tzdb::locate_zone()by using binary searches for time zone names. #5548 - Improved
std::includes()to have the same performance asranges::includes. #5543 #5595 - Improved the performance of
count()forvector<bool>. #5640
- Improved performance for
- Enhanced behavior:
- Used a new Clang compiler intrinsic to implement
is_scoped_enum. #5358 - Added debug checks for overlapping ranges in
replace_copy(),replace_copy_if(),reverse_copy(),rotate_copy(), and theirrangescounterparts. #5495 - Improved
<mdspan>'s debug checks inlayout_stride::mapping<E>'s constructor. #5505 - Avoided compiler warnings in
vector<bool>::max_size()with the compiler's upcoming implementation of Defect Report P2280R4. #5550 #5566 - Updated several checks for precondition violations and impossible situations to use the STL's usual error reporting mechanism. #5560
- Improved
regexparsing to detect excessive recursion (caused by extreme numbers of non-capturing groups or lookahead assertions) and throw aregex_errorwith the coderegex_constants::error_stack. #5588 - Changed
<regex>matching to use heap allocations for saved match state, slightly reducing stack pressure. #5682 - Silenced CodeQL warnings. #5625
- Silenced a new compiler warning C5291 throughout the STL. #5645
- Used a new Clang compiler intrinsic to implement
- Improved debugger visualization:
- Improved test coverage:
- Updated our LLVM submodule, including new tests. #5349 #5467 #5688
- Changed the benchmark build from
/O2 /Ob1to/O2 /Ob2, producing more realistic and useful results. #5370 - Added benchmarks for:
- Improved the consistency of how
normal_distributionis used in benchmarks and tests. #5404 - Increased the consistency of several benchmarks by adding allocators to control alignment. #5443
- Updated the benchmarks to support being built with Clang. #5533
- Updated an
iter_rvalue_reference_ttest in response to a compiler change. #5378 - Fixed sporadic test failures by avoiding excessive compiler memory consumption. #5383
- Improved the runtime performance of the major test for vectorized algorithms. #5425
- Added more test coverage for
search_n()andranges::search_n. #5439 #5440 - Updated the test harness to properly detect the locale name
"Czech_Czechia.1250". #5480 - Updated
source_locationtest coverage to handle upcoming changes in the EDG front-end used for IntelliSense. #5551 - Categorized the remaining
<regex>test failures in the libcxx suite. #5587 - Avoided/suppressed compiler warnings in tests. #5654 #5655 #5656 #5657 #5676
- Worked around assertions in the
lerp()test on ARM64. #5687
- Improved documentation:
- Code cleanups:
- Simplified the control flow in
ranges::search_n. #5343 - Simplified the implementation of
regexquantifiers. #5253 - Removed comments that were citing proposed resolutions for LWG issues, now that those issues have been officially resolved by the November 2024 and June 2025 meetings. #5360 #5584
- Removed compiler bug workarounds. #5410 #5580 #5634 #5661 #5674
- Significantly cleaned up the implementation of vectorized algorithms. #5429 #5450 #5485 #5532
- Removed an unnecessarily verbose internal macro. #5475
- Removed unnecessary code for constant evaluation in
char_traits::assign(). #5488 - Various cleanups (described in detail in the PRs, not repeated here). #5498 #5500 #5541 #5565 #5636
- Restructured code to
if constexpr (condition) { ... } else { ... }, improving clarity and avoiding unreachable code. #5643 - Simplified how
<chrono>initializes atmstruct. #5662
- Simplified the control flow in
- Infrastructure improvements:
- Added ARM64EC stages to Azure Pipelines. #5492 #5517 #5521
- Including an Early Build, benchmarks, and tests.
- Improved code format validation to report line numbers in error messages. #5559
- Updated dependencies. #5370 #5410 #5478 #5512 #5530 #5580 #5641 #5659 #5674
- Updated build compiler to VS 2022 17.14.12 Preview 1.
- Updated CMake to 3.31 (now required).
- Updated Google Benchmark to 1.9.4.
- Updated Python to 3.13.6.
- Updated to Windows 11 SDK 26100. This is now required for building and testing the STL, but not for using it.
- Added ARM64EC stages to Azure Pipelines. #5492 #5517 #5521
- Updated
_MSVC_STL_UPDATEand_MSVC_STL_VERSION. #5385 #5464 #5568 #5633 #5664
- Merged C++26 features:
- Merged partial C++26 features:
-
P3471R4 #5274 Standard Library Hardening
- Currently disabled by default.
- This can be enabled (for any Standard mode) by defining
_MSVC_STL_HARDENINGto1project-wide. - As C++26 Contracts are not yet implemented, this defaults to calling
__fastfail()for hardened precondition violations.
-
P3471R4 #5274 Standard Library Hardening
- Related behavior enhancement:
- Implemented "destructor tombstones" to mitigate use-after-free mistakes. #5318
- Currently disabled by default.
- This can be enabled by defining
_MSVC_STL_DESTRUCTOR_TOMBSTONESto1project-wide.
- Implemented "destructor tombstones" to mitigate use-after-free mistakes. #5318
- Merged LWG issue resolutions:
- LWG-3133 #5157 Modernizing numeric type requirements
-
LWG-3886 #5232 Monad mo' problems (in
optionalandexpected) -
LWG-3899 #5303
co_yielding elements of an lvaluegeneratoris unnecessarily inefficient -
LWG-3900 #5150 The
allocator_arg_toverloads ofgenerator::promise_type::operator newshould not be constrained -
LWG-3918 #5135 #5170
std::uninitialized_move/_nand guaranteed copy elision -
LWG-3956 #5334
chrono::parseusesfrom_streamas a customization point -
LWG-4014 #5132 LWG-3809 changes behavior of some existing
std::subtract_with_carry_enginecode -
LWG-4027 #5221
possibly-const-rangeshould prefer returningconst R& -
LWG-4084 #5151
std::fixedignoresstd::uppercase -
LWG-4112 #5152
has-arrowshould requireoperator->()to beconst-qualified -
LWG-4119 #5220
generator::promise_type::yield_value(ranges::elements_of<R, Alloc>)'s nestedgeneratormay be ill-formed -
LWG-4124 #5155 Cannot format
zoned_timewith resolution coarser than seconds -
LWG-4135 #5131 The helper lambda of
std::eraseforlistshould specify return type asbool - LWG-4140 #5129 Useless default constructors for bit reference types
-
LWG-4144 #5201 Disallow
unique_ptr<T&, D> -
LWG-4169 #5128
std::atomic<T>'s default constructor should be constrained -
LWG-4172 #5337
unique_lockself-move-assignment is broken
- 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
system_category().message()to prefer US English, followed by the system locale, with an ultimate fallback ofFormatMessageA's behavior fordwLanguageId == 0. #5104- This is consistent with
generic_category().message()(which always returns US English in our implementation) and has the best chance of returning something intelligible instead of"unknown error"or"???". - This fixed a regression that was introduced by #2669 in VS 2022 17.3.
- This is consistent with
- Fixed
regex's behavior:- To reject bogus character class ranges like
R"([\d-e])". #5158 - For negated character class escapes (
\Dfor non-digits,\Sfor non-whitespace,\Wfor non-words) when matching against Unicode characters: - For character ranges in case-insensitive mode. #5164
- For the
basicgrammar to parse a single digit for backreferences. #5167 - For its internal buffers to grow geometrically. #5175
- For the special character
.(dot). #5192 - For its constructor to accept (null, zero) arguments. #5211
- To reject bogus character class ranges like
- Fixed
filesystem::equivalent()to return correct results when shared folders are involved. #5130 - Fixed
chrono::weekday's constructor to avoid integer overflow for extreme inputs. #5156 - Fixed
push_range()forstack,queue, andpriority_queueto forward the range toc.append_range()when possible, exactly as depicted in the Standard. #5168 - Fixed code to call
ranges::beginandranges::endexactly as depicted in the Standard: - Fixed compiler errors in
range_formatterinvolving highly unusual contiguous ranges. #5187 - Fixed heterogeneous lookup for unordered containers to follow the Standard, allowing braced initializer lists to be used as arguments. #5208
- Fixed compiler errors in
views::countedinvolving highly unusual types. #5223 - Fixed integer overflow in
this_thread::sleep_for()with extremely small units (e.g. picoseconds). #5237 - Fixed
basic_string::reserve()'s ASan annotations to detect writes to its unused capacity. #5252 - Fixed how
<format>handles field width for alternate form general floating-point. #5261 - Fixed compiler errors when constructing a
basic_ispanstreamfrom a modifiablebasic_string. #5309- This fixed a regression that was introduced by #4938 in VS 2022 17.13.
- Fixed compiler errors when using
<format>in a CUDA project, by adding a compiler bug workaround. #5335 - Fixed compiler errors when converting between different specializations of
basic_const_iterator. #5325
- Fixed
- Improved performance:
- Added vectorized implementations of:
-
basic_string::find()for a character. #5101
-
- Improved the vectorized implementations of:
-
basic_string::find_first_of()andbasic_string::find_last_of(). #5029
-
-
regex_traits::translate()is now an identity function, as required by the Standard, instead of an expensive locale operation. #5209 - The STL now takes advantage of compiler support for C++23 P1169R4
static operator()in earlier Standard modes, slightly improving codegen. #5284 #5312 - Optimized the
minstd_randandminstd_rand0random number engines by avoiding constant divisions. #5256 - Slightly improved
move_only_function's constructors to do less work when setting the object to be empty. #5328
- Added vectorized implementations of:
- Enhanced behavior:
-
std::expected,std::unexpected, and all STL exception types are now marked[[nodiscard]]. #5174- This affects all user-defined functions returning these types by value. It also affects any directly constructed temporaries that are immediately discarded.
- Deprecated the non-Standard
locale::empty()static member function. #5197 - Changed the STL to avoid using
is_trivial, which is being deprecated in C++26. #5202 - Improved the STL's debug checks with better messages and fewer branches. #5270
-
- Improved debugger visualization:
- Improved test coverage:
- Simplified the test harness by dropping
ctest. Now we always directly invokestl-lit.py. #5169 - Improved the test harness to warn only once when a compiler is missing. #5199
- Categorized libcxx test failures. #5231
- Updated our LLVM submodule, including new tests. #5235
- Added test coverage for the ASan annotations in
basic_string::reserve()andvector::reserve(). #5241 - Skipped
libcxxtests in response to a new compiler warning C5321, which warns when the resolution to CWG-1656 affects au8string literal. #5283
- Simplified the test harness by dropping
- Code cleanups:
- Infrastructure improvements:
- Updated
_MSVC_STL_UPDATE. #5162 #5217 #5264 #5323
- Merged C++23 features:
- Merged C++23 Defect Reports:
- Fixed bugs:
- Fixed an infinite loop in
deque::shrink_to_fit(). #4955- This fixed a regression that was introduced by #4091 in VS 2022 17.10.
- Fixed compiler errors when constructing highly unusual
unique_ptrs (storing fancy pointers) from unspeakably evil relics of the forgotten past. #4922 - Fixed compiler errors when calling
ranges::inplace_mergewith certain combinations of elements, projections, and comparisons. #4927 - Fixed compiler errors in
basic_ispanstream's constructor andbasic_ispanstream::span()takingReadOnlyRange&&with highly unusual types. #4938 - Fixed compiler errors in the highly unusual scenario of calling
basic_stringandbasic_string_view'sfind_first_of()family of member functions for program-defined "unicorn" character types. #4951 - Fixed compiler errors when constructing
optionalfrom highly unusual types. #4961 - Fixed sequence container emplacement functions (e.g.
vector::emplace_back()) to avoid emitting "warning C5046: Symbol involving type with internal linkage not defined" for highly unusual types. #4963 #4980- This also fixed ODR violations when mixing C++14 with C++17-and-later translation units calling sequence container emplacement functions for any types.
- Fixed ODR violations when mixing C++17 with C++20-and-later translation units calling
list/forward_list::remove/remove_if/unique(). #4975 - Fixed compiler errors in
variant's converting constructor and converting assignment operator for certain types. #4966 - Fixed
bitset's streaming operatoroperator>>(basic_istream<CharT, Traits>&, bitset<N>&)to use the stream'sTraitsto compare characters. #4970 - Fixed
basic_stringandlist's internal constructors to avoid disrupting highly unusual scenarios. #4976 - Fixed compiler errors when constructing a
packaged_taskfrom a move-only function object. #4946 - For Clang
/fp:fast, fixed<cmath>and<limits>to avoid emitting-Wnan-infinity-disabledwarnings, except whennumeric_limits::infinity()/quiet_NaN()/signaling_NaN()are specifically called. #4990 - Fixed
ranges::copy_nto properly handle negative values of n (as a no-op) when activating ourmemmove()optimization. #5046- Also fixed our
memmove()optimization (used bycopy_n(),ranges::copy_n, and more) to avoid emitting compiler warnings with certain iterators.
- Also fixed our
- Fixed
filesystem::directory_entry::refresh()to avoid sporadically failing for nonexistent network paths on Windows 11 24H2. #5077 - Fixed
basic_istream::get()andbasic_istream::getline()to never write a null terminator into zero-sized buffers, and to always write a null terminator otherwise. #5073 - Fixed
assign_range()for sequence containers tostatic_assertthat the container elements are assignable from the range's reference type. #5086 - Fixed compiler errors in various ranges algorithms when used with
views::iotain certain scenarios. #5091
- Fixed an infinite loop in
- Improved performance:
- Added vectorized implementations of:
-
basic_string::find_first_of(). #4744 -
basic_string::find_last_of(). #4934 -
basic_string::find()for a substring. #5048 -
basic_string::rfind()for a substring. #5057 -
basic_string::rfind()for a single character. #5087 -
search(),ranges::search, anddefault_searcher, for 1-byte and 2-byte elements. #4745 -
find_end()andranges::find_end, for 1-byte and 2-byte elements. #4943 #5041 #5042 -
bitset's constructors from strings. #4839 -
remove()andranges::remove. #4987
-
- Improved the vectorized implementations of:
- Helped the compiler auto-vectorize:
-
rangesalgorithms now unwrap output iterators, avoiding unnecessary checking. #5015 #5027 - Optimized
bitset's streaming operators. #5008 - Optimized the newline-printing overloads
println(FILE*),println(ostream&), and nullaryprintln(). #4672 - Updated
arrayandvector's spaceship comparison operators to take advantage of the vectorized implementation oflexicographical_compare_three_way(). #5078 - Extended the "key extraction" optimization in the unique associative containers (both ordered and unordered) to handle more types. #5050
- Optimized
filesystem::symlink_status()by avoiding unnecessary Windows API calls. #5071
- Added vectorized implementations of:
- Improved throughput:
- Improved C++23 throughput by not including all of
<ostream>(which drags in<format>) unless the Standard requires it. #4936 - Improved C++23 throughput of
<queue>,<stack>,<stacktrace>, and<thread>by not including all of<format>. #5003 - Moved
system_clock,high_resolution_clock, andchrono_literalsfrom a commonly-included internal header to<chrono>. #5105- This has source-breaking impact. If you see compiler errors complaining that it doesn't recognize
chronotypes likesystem_clockor UDLs like1729ms, you need to include<chrono>specifically, instead of assuming that headers like<thread>will drag it in.
- This has source-breaking impact. If you see compiler errors complaining that it doesn't recognize
- Improved C++23 throughput by not including all of
- Enhanced behavior:
- Changed an internal
pairconstructor to beprivate. #4979 - Fixed a CodeQL warning by replacing a squirrelly
memcpy()call in thefilesystemimplementation (that was intentionally performing a read overrun) with two cromulentmemcpy()calls. #4933 - Silenced CodeQL warnings. #4942 #4985 #5072
- Added a visualizer for
system_clock::time_point. #5005 - Changed some
vectormachinery to use scope guards instead ofthrow;, making debugging easier when exceptions are thrown. #4977 - Improved
regex_error::what()'s message forregex_constants::error_badbrace. #5025 - Improved
optional<T>::swap()'sstatic_assertmessages whenTisn't both move constructible and swappable. #5065 - Removed
locale::id's non-Standard constructor fromsize_tand implicit conversion operator tosize_t. #5067- For user-visible headers, at least. They remain dllexported for binary compatibility.
- Improved
mutexassertions to distinguish "unlock of unowned mutex" from "unlock of mutex not owned by the current thread". #5099
- Changed an internal
- Improved test coverage:
- Updated tests to work with Clang 18. #4932 #4937
- Fixed sporadic failures in a
timed_mutextest. #4973 - Extended CUDA test coverage beyond C++14, adding C++17 and C++20. #4974
- When Python
psutilis installed, the test harness now supports apriorityparameter, defaulting toidle. #5032 - Increased the consistency of the
swap_ranges()benchmark by adding allocators to control alignment. #5043 - Updated our LLVM submodule, including new tests. #5038
- Divided the increasingly large test for vectorized algorithms into smaller parts, extracting
mismatch(),lexicographical_compare(), andlexicographical_compare_three_way()into a separate test. #5063
- Code cleanups:
- Removed compiler bug workarounds. #4939 #4944 #4947 #5017 #5103
- Explicitly marked
packaged_task's defaulted move constructor and move assignment operator asnoexcept. #4940 - Various cleanups (described in detail in the PRs, not repeated here). #4945 #5014 #5058
- Refactored internal usage of the
tuple-likeandpair-likeconcepts. #4983 - Used
if constexprto simplifyeldritch horrors from beyond spacetimelocale facets. #5001 - Simplified control flow in
basic_string::find_first_not_of()/find_last_not_of(). #5006 - Refactored the vectorized implementation of
bitset::to_string(). #5013 - Replaced SFINAE with concepts in C++20-and-later code. #5044
- Improved documentation:
- Removed an inaccurate comment in
list's move assignment operator. #5024
- Removed an inaccurate comment in
- Infrastructure improvements:
- Build system improvements:
- Removed a workaround in the benchmark build. #4928
- Updated
_MSVC_STL_UPDATE. #4926 #4994 #5064
- Merged C++26 features:
-
P0952R2 #4740 #4850 A New Specification For
generate_canonical() - P2407R5 #4743 Freestanding Library: Partial Classes
-
P2833R2 #4743 Freestanding Library:
inoutexpectedspan -
P2968R2 #4777 Make
std::ignoreA First-Class Object - P2997R1 #4816 Removing The Common Reference Requirement From The Indirectly Invocable Concepts
-
P0952R2 #4740 #4850 A New Specification For
- Merged C++23 features:
- Merged LWG issue resolutions:
-
LWG-3944 #4784 Formatters converting sequences of
charto sequences ofwchar_t -
LWG-4061 #4758 Should
std::basic_format_contextbe default-constructible/copyable/movable? -
LWG-4074 #4814
compatible-joinable-rangesis underconstrained -
LWG-4083 #4786
views::as_rvalueshould reject non-input ranges -
LWG-4096 #4785
views::iota(views::iota(0))should be rejected -
LWG-4098 #4815
views::adjacent<0>should reject non-forward ranges -
LWG-4106 #4757
basic_format_argsshould not be default-constructible
-
LWG-3944 #4784 Formatters converting sequences of
- 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 static analysis warning C26818 "Switch statement does not cover all cases. Consider adding a 'default' label (es.79)." #4715
-
Note: The STL has always attempted to be
/W4 /analyzeclean, but does not yet attempt to be clean with respect to all additional static analysis rulesets.
-
Note: The STL has always attempted to be
- Fixed
atomic_ref::is_lock_free()on x64 to returntruefor 1, 2, 4, 8, and 16 bytes only. #4729 - Fixed
uniform_real_distribution<RealType>{min, max}to stay within the inclusive-exclusive range[min, max)and never generate themaxvalue exactly. #4740 - Fixed
filesystem::weakly_canonical()to avoid failing on Windows 11 24H2 in certain scenarios. #4844 - Fixed
condition_variable_any::wait_for()to consistently usesteady_clock. #4755 - Removed a broken and useless visualizer for
ranges::view_interface. #4835 - Fixed the visualizer for
move_iteratorto use the updated name of its internal data member. #4836- This fixed a regression that was introduced by #1080 in VS 2019 16.8.
- Fixed
expectedto conditionally delete its copy constructor and copy assignment operator as depicted in the Standard, which affects overload resolution in unusual scenarios. #4837 - Fixed
time_put/put_time()to avoid crashing for: - Fixed compiler errors in
ranges::inplace_mergeandranges::minmaxin unusual scenarios. #4841 - Fixed truncation warnings when:
- Improved
array::size()and<mdspan>static analysis annotations, fixing warnings in some scenarios. #4856 - Fixed
lexicographical_compare_three_way()to enforce the Standard's mandate that the comparison returns a comparison category type. #4878 - Fixed compiler errors in the parallel scan algorithms
inclusive_scan(),exclusive_scan(),transform_inclusive_scan(), andtransform_exclusive_scan()when the intermediate and output types are different. #4701 - Fixed the vectorized implementation of floating-point
ranges::min,ranges::max, andranges::minmaxto return correct results for negative zeros. #4734 - Fixed Clang compiler errors for certain
constexprvariantscenarios by adding a compiler bug workaround. #4903 - Fixed compiler errors when using
<random>machinery (e.g.generate_canonical(),uniform_real_distribution) via Standard Library Modules or Standard Library Header Units by adding compiler bug workarounds. #4906 - Fixed compiler errors when using
<format>machinery in user-defined modules by adding compiler bug workarounds. #4919 - Fixed
<format>to avoid crashing when formatting floating-point values with large precisions combined with the#(alternate form) orL(locale-specific form) options. #4907
- Fixed static analysis warning C26818 "Switch statement does not cover all cases. Consider adding a 'default' label (es.79)." #4715
- Improved performance:
- Overhauled
condition_variableandcondition_variable_any, improving their performance and simplifying their implementation. #4720- As a result,
condition_variable,timed_mutex, andrecursive_timed_mutexare now trivially destructible.
- As a result,
- Improved the performance of
search(),find_end(), and theirrangesforms by removing calls tomemcmp()that were surprisingly harmful. #4654 #4753 - Improved the ARM64 performance of
popcount()by using new compiler intrinsics. #4695 #4733 - Further improved the vectorized implementations of:
- Slightly improved the performance of
ranges::min,ranges::max, andranges::minmaxfor certain iterator types. #4775 - On x86, the STL is now built with
/arch:SSE2(which is the default) instead of/arch:IA32. #4741- See
/arch(x86) on Microsoft Learn.
- See
- Used Clang builtins to improve the performance of
<cmath>'s floating-point comparison functions for mixed types. #4648 - On x64,
atomic_ref<16 bytes>now always uses the cmpxchg16b instruction. #4751 - Streaming a small
bitsetto abasic_ostreamnow avoids dynamically allocating memory. #4818 - Slightly improved performance for Clang ARM64
<atomic>. #4870 - Updated
char_traits<wchar_t/char16_t>::compare/find/length,find, andranges::findto callwmemcmp/wmemchr/wcslenwhen possible, which will improve performance after a future UCRT header update. #4873 #4894 - Optimized equality comparisons for empty
strings andstring_views. #4904
- Overhauled
- Improved throughput:
- Improved
<queue>and<stack>throughput by dragging in fewer headers. #4707
- Improved
- Enhanced behavior:
-
P0608R3 Improving
variant's Converting Constructor/Assignment is now unconditionally active (i.e. in C++17 mode and above), instead of being restricted to C++20 mode and above. #4713- This C++20 behavioral change was originally implemented by #1629 in VS 2019 16.10. While it can have source-breaking impact, it generally has highly desirable effects.
- Changed the machinery for copying
map/setnodes to use scope guards instead ofthrow;, making debugging easier when exceptions are thrown. #4749 - Added debug checks to
gcd()andlcm()for precondition violations. #4776 - Added "lifetimebound" attributes to
min,max,clamp,ranges::min,ranges::max, andranges::clamp, allowing MSVC code analysis and Clang-Wdanglingto detect dangling references in improper usage. #4838 - Updated the precondition check in
vector::pop_back()to be guarded by_CONTAINER_DEBUG_LEVEL. #4849 - Renamed the parameters of
views::iotaandviews::repeatto provide better IDE guidance. #4908 - Simplified internal locale facet machinery to use class-specific
operator newandoperator deleteoverloads in both release and debug mode. #4916
-
P0608R3 Improving
- Improved debugger visualization:
- Improved test coverage:
- Updated LLVM-derived test coverage for
<any>,<optional>, and<variant>. #4713 - Properly tested the resolution of LWG-4053 "Unary call to
std::views::repeatdoes not decay the argument". #4748 - Improved the benchmarks for
bitset::to_string(). #4817 - Updated our LLVM submodule, including new tests. #4862 #4910
- Re-enabled tests that were previously skipped in the
libcxxtest suite. #4721 #4732 #4911 - Skipped tests that were sporadically failing due to incorrect timing assumptions. #4885
- Added compiler bug workarounds. #4895
- Tested the resolution of LWG-4105 "
ranges::ends_with's Returns misses difference casting". #4897 - Updated tests to work with Clang 19. #4912
- Avoided unnecessary usage of
rand(), which is considered harmful. #4921
- Updated LLVM-derived test coverage for
- Code cleanups:
- Removed compiler bug workarounds. #4725 #4782 #4889
- Various cleanups (described in detail in the PRs, not repeated here). #4724 #4900 #4920
- Replaced SFINAE with concepts in C++20-and-later code. #4718 #4819
- Removed a significant amount of unused code calling
GetCurrentPackageId. #4742 - Simplified how
ranges::equalcompares sizes. #4864
- Reverted change:
- Infrastructure improvements:
- Build system improvements:
- Added
/Zc:preprocessorto build the STL with the conformant preprocessor. #4886 - Improved how CMake searches for the clang-format executable. #4888
- Added
- Updated
_MSVC_STL_UPDATE. #4706 #4708 #4754 #4872