Skip to content

VS 2022 17.3

Compare
Choose a tag to compare
@StephanTLavavej StephanTLavavej released this 09 Mar 05:26
· 1154 commits to main since this release
60decd0
  • Merged C++23 features:
  • Merged partial C++23 features:
    • P2321R2 zip:
      • Changes to tuple, pair, and vector<bool>::reference. #2687
  • Merged LWG issue resolutions:
    • LWG-3121 #2640 tuple constructor constraints for UTypes&&... overloads
    • LWG-3525 #2639 uses_allocator_construction_args fails to handle types convertible to pair
    • LWG-3570 #2418 basic_osyncstream::emit should be an unformatted output function
    • LWG-3571 #2418 flush_emit should set badbit if the emit call fails
  • Merged proposed resolutions for LWG issues (not yet accepted for the C++ Working Draft, but we've chosen to implement this speculatively):
    • LWG-3234 #2703 Sufficient Additional Special Math Overloads
    • LWG-3627 #2607 Inconsistent specifications for std::make_optional overloads
  • Fixed bugs:
    • Fixed vector<bool> to properly invalidate iterators during reallocation, which fixes compiler errors with constexpr usage of vector<bool>. #2441
    • empty_view rvalues are now considered borrowed_ranges as required by the Standard. #2576
    • Added compiler bug workarounds to is_convertible and common_reference, so contiguous_iterator<const volatile int*> is now true. #2592
    • Added missing constraints to functions that were implied by "Effects: Equivalent to" Standardese: make_any(), make_optional(), shared_ptr::operator=(), shared_ptr::reset(), and weak_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
      • This fixed a regression that was introduced by #2000 implementing P1989R2 Range Constructor For string_view in VS 2022 17.0.
    • 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".
    • Fixed an out-of-bounds read in ranges::find() with unreachable_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 ExecutionPolicy overloads of copy_backward() and move_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-point durations. #2638
    • Fixed <bit>'s countl_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() and time_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() and atomic<8-byte type>::store(). #2702
    • Fixed compiler errors in atomic<shared_ptr<T[]>>, atomic<shared_ptr<T[N]>>, atomic<weak_ptr<T[]>>, and atomic<weak_ptr<T[N]>>. #1339
    • Added overloads of <cmath>'s lerp() for arithmetic types. #2113
    • Fixed filesystem::directory_entry to work with FAT32 and exFAT. #2373
    • <filesystem> now handles special system files like hiberfil.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 of copy_options). #2718
    • Fixed the visualizers for shared_ptr<void>, weak_ptr<void>, and unique_ptr<void, Deleter>. #2706
    • Fixed compiler errors in move_only_function when compiling <functional> in /std:c++latest mode 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.
    • 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_initialize and __imp___std_init_once_complete.
      • On x86, these errors mentioned __imp____std_init_once_begin_initialize@16 and __imp____std_init_once_complete@12.
      • This fixed a regression that was introduced by #2381 in VS 2022 17.2.
      • This fix was backported to VS 2022 17.2.5.
  • Improved performance:
    • Optimized rotl() and rotr() 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(), and ranges::count(), with speedups ranging from 2.0x to 27.6x (times, not percent). #2434
    • Slightly improved the performance of <charconv> floating-point from_chars(). #2623
  • Improved throughput:
    • Used if constexpr instead of tag dispatch, overloads, or specializations in:
      • is_permutation(), sample(), rethrow_if_nested(), and default_searcher. #2219
      • <map> and <set>'s common machinery. #2287
      • polymorphic_allocator. #2471
      • basic_string_view and basic_string's find_first_of(), find_last_of(), find_first_not_of(), and find_last_not_of(). #2479 #2660
      • <regex>. #2484
      • Parallel inclusive_scan() and transform_inclusive_scan(). #2662
      • scoped_allocator_adaptor's operator==(). #2677
      • function, move_only_function, and bind(). #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
  • Enhanced behavior:
    • Changed <deque> to use scope guards instead of throw;, making debugging easier when exceptions are thrown. #2308
    • Merged an MSVC-specific attribute, allowing the compiler to improve its handling of constexpr dynamic allocation and constexpr 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
    • C++98's unexpected() in <exception> was removed by C++17. As with almost all removals, we support an escape hatch to restore unexpected(), by defining _HAS_UNEXPECTED to 1. However, this escape hatch conflicts with C++23, which is reusing the identifier for unexpected<E> in <expected>. Therefore, the escape hatch is now blocked with an #error in 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_view for non-forward_ranges until LWG-3698 is resolved. #2727
    • <random> distributions now have non-const function call operators, making it easier to write portable code. #2732
  • Improved documentation:
    • Added comments to the test suite citing GitHub issues and LWG issues. #2433
    • Expanded a comment about the build system's use of /Os. #2708
  • Improved test coverage:
    • Dramatically improved the compiler memory consumption and compile time of two ranges algorithm tests. #2657
    • Removed /Za test coverage. #2714
  • 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++20 and /std:c++latest modes. #2637
  • Infrastructure improvements:
    • Fixed the build system to avoid relinking any DLLs when rerunning CMake and Ninja with no other changes. #2606
    • Added format and validate targets 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 #2714
      • Updated build compiler to VS 2022 17.3 Preview 1 (17.2 is now required).
      • Updated to Windows 11 SDK 22000. This is now required for building and testing the STL, but not for using it. #2729
      • Updated Python to 3.10.4.
  • Updated _MSVC_STL_UPDATE. #2634 #2696