Skip to content

VS 2022 17.6

Compare
Choose a tag to compare
@StephanTLavavej StephanTLavavej released this 09 Mar 05:28
· 789 commits to main since this release
28a6aab
  • Merged C++23 features:
  • Merged partial C++23 features:
    • P2165R4 Compatibility Between tuple, pair, And tuple-like Objects:
    • P2321R2 zip:
      • views::zip_transform. #3322
      • Note: views::adjacent and views::adjacent_transform remain to be implemented.
  • Merged LWG issue resolutions:
    • LWG-3515 #3236 [stacktrace.basic.nonmem]: operator<< should be less templatized
    • LWG-3545 #3242 std::pointer_traits should be SFINAE-friendly
    • LWG-3594 #3276 inout_ptr - inconsistent release() in destructor
    • LWG-3629 #3272 make_error_code and make_error_condition are customization points
    • LWG-3646 #3261 std::ranges::view_interface::size returns a signed type
    • LWG-3717 #3266 common_view::end should improve random_access_range case
    • LWG-3736 #3318 move_iterator missing disable_sized_sentinel_for specialization
    • LWG-3737 #3320 take_view::sentinel should provide operator-
    • LWG-3743 #3269 ranges::to's reserve may be ill-formed
    • LWG-3746 #3265 optional's spaceship with U with a type derived from optional causes infinite constraint meta-recursion
    • LWG-3769 #3459 basic_const_iterator::operator== causes infinite constraint recursion
    • LWG-3772 #3462 repeat_view's piecewise constructor is missing preconditions
    • LWG-3778 #3332 vector<bool> missing exception specifications
    • LWG-3785 #3319 ranges::to is over-constrained on the destination type being a range
    • LWG-3798 #3359 Rvalue reference and iterator_category
    • LWG-3810 #3421 CTAD for std::basic_format_args
    • LWG-3823 #3231 Unnecessary precondition for is_aggregate
    • LWG-3848 #3410 slide_view missing base accessor
    • LWG-3850 #3423 views::as_const on empty_view<T> should return empty_view<const T>
    • LWG-3853 #3468 basic_const_iterator<volatile int*>::operator-> is ill-formed
  • Merged proposed resolutions for LWG issues (not yet accepted for the C++ Working Draft, but we've chosen to implement this speculatively):
    • LWG-3857 #3348 basic_string_view should allow explicit conversion when only traits vary
    • LWG-3867 #3367 Should std::basic_osyncstream's move assignment operator be noexcept?
  • Fixed bugs:
    • Fixed linker errors when using time_put<wchar_t> from the Standard Library Modules. #3232
    • Fixed another unintentionally dllexported symbol in the import library. #3233
      • This would emit a spurious message "Creating library meow.lib and object meow.exp" (while building meow.exe) when using <stacktrace> or importing the Standard Library Modules.
    • Fixed a binary compatibility break in basic_string, which could lead to missing null terminators causing crashes and other runtime misbehavior, when linking code that was built with different versions of the STL. #3235
      • This ABI break was introduced by #1735 activating the Small String Optimization for constexpr basic_string in VS 2022 17.4.
      • The affected scenarios involved mixing VS 2022 17.3 (or earlier) with VS 2022 17.4 (or later, until this fix).
      • We backported this fix to VS 2022 17.4.5 and VS 2022 17.5.
    • Fixed a binary compatibility break in ppltasks.cpp powering std::async(), which could lead to crashes caused by an invalid_operation exception slamming into noexcept. #3255
      • This ABI break was introduced by #2654, and appeared in VS 2022 17.4 when the VCRedist was "unlocked".
      • The affected scenarios involved building with VS 2015 (or possibly early versions of VS 2017), using "Single-Threaded Apartments", and running on an end user's machine with the VS 2022 17.4 VCRedist installed.
      • We backported this fix to VS 2022 17.4.5 and VS 2022 17.5.
    • Fixed incorrect results from find(), count(), ranges::find(), and ranges::count(). #3247
      • This fixed a regression that was introduced by #2434 in VS 2022 17.3.
      • The affected scenarios involved mixing certain signed and unsigned types; for example, finding/counting occurrences of the int -1 in a range of unsigned int elements should consider the element 0xFFFF'FFFFu to be equal (due to C++'s usual arithmetic conversions), but it was incorrectly considered to be non-equal.
      • We backported this fix to VS 2022 17.4.5 and VS 2022 17.5.
    • Fixed the visualizer for optional<T> to work when T has a custom visualizer. #3243
    • Fixed compiler warnings when passing long double to copysign(). #3253
    • Re-enabled ASan (Address Sanitizer) annotations in <string> after fixing significant bugs. #3164
      • Also fixed ASan annotations in <vector> that were failing when pmr::vector was used with pmr::monotonic_buffer_resource on x86.
    • Fixed compiler errors when passing ranges types to std::copy(). #3270
    • Fixed shared_future<void>'s move assignment operator to be noexcept as required by the Standard. #3284
    • Fixed Clang compiler errors involving intrinsics by including <intrin.h>, which is a header that Clang recognizes and supports. #3285
    • Fixed numeric_limits to correctly report that is_signed is true for the STL's internal 128-bit signed-integer-class type. #3291
    • Fixed <stacktrace> to correctly pass SYMOPT_FAIL_CRITICAL_ERRORS to the Windows API. #3292
    • Fixed <charconv> (and headers that include it, like <chrono> and <format>) to avoid emitting warning C4365 "signed/unsigned mismatch" when being compiled with /J. #3295
      • Note: We strongly discourage any use of the /J compiler option, as it's a recipe for One Definition Rule violations and it doesn't improve Standard conformance.
    • Fixed ranges::cbegin, ranges::cend, ranges::crbegin, ranges::crend, and ranges::cdata to behave like their non-const counterparts when given array rvalues. #3316
    • Added compiler bug workarounds:
      • For Clang in <expected>. #3326
      • For Clang in <ranges>. #3328
      • For MSVC modules in <filesystem>. #3331
    • Fixed constexpr basic_string to correctly start the lifetimes of its elements, avoiding compiler errors. #3334
    • Fixed views::istream constraints to precisely follow the Standard. #3335
    • Implemented C++17's parallel specialized <memory> algorithms. #3145
      • These were mistakenly omitted when P0040R3 Extending Memory Management Tools and P0024R2 Parallel Algorithms were implemented (in VS 2017 15.3 and 15.7, respectively).
    • Fixed vector<bool, Alloc> on 32-bit platforms with 64-bit difference_types to support storing more than 232 bits. #3342
    • Fixed a compiler error when calling ranges::prev on an iota_view iterator in debug mode. #3356
    • Fixed ranges::minmax to avoid moving from an element twice when called with a single-element range of move_iterators. #3366
    • Fixed a minor conformance issue in the std.ixx Standard Library Module. #3373
      • When module; introduces a global module fragment, it is required to be the first thing in the file other than comments, although MSVC doesn't enforce this rule yet.
    • Changed the STL's usage of a compiler-specific custom attribute to defend against macros. #3380
    • Fixed Clang -Wdeprecated warnings that said "out-of-line definition of constexpr static data member is redundant in C++17 and is deprecated". #3381
    • Changed vformat_to() to instantiate its machinery in a lazier way. #3403
      • When merely including <format> or <chrono>, this avoids instantiating dynamic initializers for facet IDs, and improves throughput slightly.
  • Improved performance:
    • Avoided constructing unnecessary strings in locale::operator==(). #3250
    • Activated count()'s vectorized implementation for more eligible iterators in C++14/17 modes. #3262
    • Activated the vectorized implementations of find(), count(), ranges::find(), and ranges::count() for more scenarios involving pointer elements. #3267
    • Optimized <atomic> for ARM64, massively improving load-acquire and store-release (measured 14.1x to 23.8x speedups - times, not percent) and significantly improving sequentially consistent stores (measured 1.58x speedup). #3399
    • ranges::find now calls memchr() in more situations (when the vectorized implementation isn't available). #3386
  • Improved throughput:
    • Moved user-defined literals for the STL's internal 128-bit integer-class types from product code to test code. #3252
    • Removed unnecessary operator== and operator!= overloads for internal types in C++20 mode. #3256
    • Used if constexpr instead of overloads in internal machinery. #3389
  • Enhanced behavior:
    • The STL now supports /clr for C++11 multithreading (mutex, condition_variable, future, etc.) and C++17 parallel algorithms. Additionally, the STL now allows /clr to be used in C++20 mode. #3194 #3201
      • See tracking issue #3193 for a list of compiler bugs that affect these newly enabled /clr scenarios.
    • Added visualizers for error_category and error_code. #3204
    • Improved the output of source_location::function_name(). #3206
      • For example, it now returns "int __cdecl square(int)" instead of "square".
    • When iterator debugging detects bogus usage of an invalidated vector iterator, it now displays an assertion message instead of abruptly crashing. #3282
    • Changed <mutex> to use scope guards instead of throw;, making debugging easier when exceptions are thrown. #3321
    • Strengthened the exception specifications for:
      • mutex::unlock(), recursive_mutex::unlock(), and unique_lock's move assignment operator. #3321
      • Various member functions and swap() overloads for stream types. #3314
      • Various non-member and member functions in <condition_variable>, <mutex>, <shared_mutex>, and <thread>. #3388
    • Added modules/modules.json to support build systems. #3358 #3488
    • Refactored ranges::minmax and ranges::minmax_element to detect the single-element case naturally. #3384
    • Changed the STL's user-defined literals to be consistently defined as operator""meow without a space, because CWG-2521 is deprecating the form operator"" woof with a space. #3453
  • Improved documentation:
    • Clarified the error message when including the internal header <__msvc_cxx_stdatomic.hpp> in C mode. #3192
  • Improved test coverage:
    • Enabled <stdatomic.h> test coverage for Clang. #3186
    • Updated the modules tests after a compiler bugfix for source_location. #3339
    • Added more tests for views::elements. #3350
    • Updated our LLVM submodule reference, including new tests. #3344 #3357
    • Added more tests for views::drop, views::drop_while, views::take, and views::take_while. #3390
  • Code cleanups:
    • Removed compiler bug workarounds. #3202 #3288 #3351 #3350
    • Removed comments that were citing proposed resolutions for LWG issues, now that those issues have been officially resolved by the November 2022 and February 2023 meetings. #3238 #3461
    • Improved consistency in preprocessor comments. #3208
    • Simplified a line in experimental::filesystem::recursive_directory_iterator::operator++(). #3279
    • Various cleanups (described in detail in the PRs, not repeated here). #3293 #3300
    • Removed unused internal machinery. #3299
    • Simplified types by defaulting some of their special member functions:
      • promise and packaged_task. #3315
      • shared_mutex, shared_timed_mutex, and shared_lock. #3352
    • Changed more temporary objects to be constructed with braces instead of parentheses. #3277
    • Updated comments after a compiler bug was fixed. #3394
    • Updated tests and separately compiled sources to directly use the [[nodiscard]] attribute. #3397
    • Updated notes for skipped tests in the libcxx test suite. #3464
  • Infrastructure improvements:
    • Added GitHub Actions to automatically add PR cards to the Code Reviews project. #3393
    • Fixed the build system to properly pass options when assembling the "alias objects". #3402
    • Updated dependencies. #3202 #3288 #3340 #3351 #3467
      • Updated build compiler to VS 2022 17.5 Preview 6 (now required).
      • Updated CMake to 3.25 (now required).
      • Updated Python to 3.11.2.
      • Updated Boost.Math to 1.81.0. #3312
  • Updated _MSVC_STL_UPDATE. #3191 #3264 #3362 #3395