New
VS 2022 17.14
- 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 and guaranteed copy elision
- 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:
- To reject bogus character class ranges like
- 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.
- 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