·
129 commits
to main
since this release
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 x86 (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.
- This fix was backported to VS 2022 17.14.20.
- 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 x64/x86 vectorized implementations of:
basic_string::find_first_not_of()andbasic_string::find_last_not_of()for one character. #5102basic_string::find_first_not_of()andbasic_string::find_last_not_of()for multiple characters. #5206adjacent_find()andranges::adjacent_find. #5331unique()andranges::unique. #5092 #5363search_n()andranges::search_nfor small values of n. #5352remove_copy(),ranges::remove_copy,unique_copy(), andranges::unique_copy. #5355is_sorted_until()andranges::is_sorted_until. #5420 #5540search(),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 x64/x86 vectorized implementations of:
reverse_copy()andranges::reverse_copy. #5493
- Improved the ARM64EC vectorized implementations of:
find()andranges::find. #5597
- 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 x64/x86 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