Skip to content

VS 2022 17.9

Compare
Choose a tag to compare
@StephanTLavavej StephanTLavavej released this 09 Mar 05:30
· 275 commits to main since this release
900eeac
  • Merged C++23 features:
    • P0009R18 #3972 #4037 <mdspan>
      • P2599R2 mdspan: index_type, size_type
      • P2604R0 mdspan: data_handle_type, data_handle(), exhaustive
      • P2613R1 mdspan: empty()
      • P2763R1 Fixing layout_stride's Default Constructor For Fully Static Extents
    • P1169R4 #4053 static operator()
      • This updates CTAD (class template argument deduction) for std::function and packaged_task to work with a C++23 Core Language feature, currently supported for Clang only. When MSVC and IntelliSense implement this Core feature, this will automatically "light up" the STL's CTAD for them too.
  • Merged partial C++23 features:
    • P2286R8 Formatting Ranges:
      • Implemented formatter::set_debug_format(). #3913
      • Implemented formattable, range_format, and format_kind. #4116
  • Merged LWG issue resolutions:
    • LWG-3561 #4066 Issue with internal counter in discard_block_engine
  • Fixed bugs:
    • Fixed incorrect results from iostreams floating-point parsing (e.g. "1e-07" was incorrectly parsed as 1e-06). #3982
      • This fixed a regression that was introduced by #3364 in VS 2022 17.7.
      • We backported this fix to VS 2022 17.8.
    • Fixed compiler errors when using expected together with any. #4013
    • Fixed incorrect behavior when self-move-assigning any, and fixed compiler errors in any involving incomplete types. #3965
    • Fixed bugs in basic_string's copy assignment operator, specific to non-equal propagate_on_container_copy_assignment allocators, involving ASan annotations or fancy pointers. #4031
    • Fixed get() and comparison operators to handle program-defined specializations of array. #4041
    • Fixed compiler errors in to_array() involving incomplete types. #4042
    • Fixed linker errors involving stl_asan.lib by disabling ASan annotations in the STL for unsupported platforms (e.g. ARM, ARM64, ARM64EC). #4058
    • Fixed not_fn() to return a perfect forwarding call wrapper in C++20 mode as required by P0356R5. #4057
    • Fixed deque to preserve its internal invariants when taking advantage of allocators that provide allocate_at_least(). #4017
    • Fixed deque emplace() and insert() to not require elements to be swappable; this change also improved performance. #4022
    • Fixed deque to handle highly unusual fancy pointers. #4049
    • Fixed deque::shrink_to_fit() to avoid requiring the allocator to be default constructible. #4071
    • Fixed allocate_shared() for unbounded arrays to handle fancy pointers. #4074
    • Fixed the implementation of P0408R7 Efficient Access To basic_stringbuf's Buffer to properly destroy fancy pointers. #4047
    • Fixed this_thread::sleep_until() to consistently use the given time_point's clock type, instead of also depending on the system clock. This also fixed this_thread::sleep_for() to consistently use steady_clock. #3914
    • Fixed minor conformance issues in <random>: #4120
      • Removed non-Standard base_type typedefs from discard_block_engine, independent_bits_engine, and shuffle_order_engine.
      • Fixed discard_block_engine(Engine&&) to move-construct the base engine instead of copying it.
  • Improved performance:
    • Optimized the copy(), copy_n(), and move() algorithms for vector<bool> iterators, with speedups varying from 1.8x (times, not percent) to an incredible 3200x, depending on the size and alignment of the bits being copied. #3353 #4045
    • Optimized priority_queue::push_range() for small ranges. #4025
    • Improved debug codegen for deque by using unchecked iterators internally. #4071
    • Optimized basic_string's range constructors to use memmove() for contiguous ranges when possible. #4073
    • Added a vectorized implementation of ranges::find_last. #3925
  • Enhanced behavior:
    • Added debug checks to <valarray> binary operations, verifying that the operands have the same size. #3911
    • Deprecated basic_istream's ipfx()/isfx() and basic_ostream's opfx()/osfx() member functions as they're non-Standard extensions. #4006
    • Added compiler bug workarounds for the upcoming Clang 17 release. #4014
    • Improved the STL's error messages so that error logs will record specific static_asserts like "error STL1000: Unexpected compiler version, expected Clang 16.0.0 or newer." instead of just "Error in C++ Standard Library usage." #4020
    • Silenced /Wall warnings:
      • When building the Standard Library Modules. #4026
      • Warning C4868 "compiler may not enforce left-to-right evaluation order in braced initializer list" throughout the STL. #4067
      • Note: /Wall is not intended for regular production use, as it contains a large number of extremely noisy and low-value warnings. In general, the STL does not attempt to be /Wall clean.
    • Changed num_get::do_get() to tolerate 80-bit long double by removing a static_assert that was added in 2018. #4032
      • Note: 80-bit long double remains unsupported by MSVC.
    • Improved source_location::function_name(): #4055
      • It will return detailed information for Clang 17.
      • Added an "escape hatch" for all compilers: define _USE_DETAILED_FUNCTION_NAME_IN_SOURCE_LOCATION to 0.
      • For example, given template <typename T> void cats() called with cats<vector<int>>(), MSVC's detailed info (implemented in VS 2022 17.6) is "void __cdecl cats<class std::vector<int,class std::allocator<int> >>(void)". Clang 17's detailed info is "void __cdecl cats(void) [T = std::vector<int>]". The escape hatch will return the basic info "cats".
    • Changed the ranges algorithms to be ordinary function objects. #4098
      • For example, this allows code like views::transform(ranges::distance) to compile.
    • Marked internal extern "C" functions as noexcept. #4106 #4150
      • This improves codegen for /EHs (versus /EHsc, where extern "C" already implies noexcept).
  • Improved test coverage:
    • Added an STL-ASan-CI pipeline. #3987 #3989 #4029 #4052 #4068 #4069 #4075
    • The test harness now cleans up emitted files as it runs. #4086
    • Simplified the feature-test macro test. #4103
    • Enabled test coverage for basic_string's ASan annotations when exception handling interacts with the Small String Optimization. #4118
  • Code cleanups:
  • Improved documentation:
    • Improved the consistency of preprocessor comments. #3950
  • Infrastructure improvements:
    • Updated dependencies. #4028 #4039 #4083
      • Updated build compiler to VS 2022 17.8 Preview 3 (now required).
      • Updated CMake to 3.27 (now required).
      • Updated Python to 3.12.0 (now required).
      • Updated Google Benchmark to 1.8.3. #4021
  • Updated _MSVC_STL_UPDATE. #4003 #4062