Skip to content

VS 2022 17.8

Compare
Choose a tag to compare
@StephanTLavavej StephanTLavavej released this 09 Mar 05:29
· 494 commits to main since this release
ab60075
  • Merged C++26 features:
    • P2013R5 #3837 Freestanding Language: Optional ::operator new
    • P2198R7 #3837 Freestanding Feature-Test Macros And Implementation-Defined Extensions
    • P2338R4 #3837 Freestanding Library: Character Primitives And The C Library
    • P2538R1 #3822 ADL-Proof projected
  • Merged C++23 features:
  • Merged C++20 extension:
    • The C++23 named modules std and std.compat are now available when compiling in C++20 mode. #3977
      • This extension should eventually be portable to the major Standard Library implementations via an informal agreement between implementers.
      • Build systems - including the Visual Studio IDE - will need changes to support import std in C++20. This change makes it possible for them to do so.
  • Merged LWG issue resolutions:
    • LWG-3631 #3745 basic_format_arg(T&&) should use remove_cvref_t<T> throughout
    • LWG-3843 #3737 std::expected<T, E>::value() & assumes E is copy constructible
    • LWG-3893 #3782 LWG-3661 broke atomic<shared_ptr<T>> a; a = nullptr;
    • LWG-3904 #3781 lazy_split_view::outer-iterator's const-converting constructor isn't setting trailing_empty_
  • Fixed bugs:
    • Fixed the deque(size_type) constructor to properly destroy elements when constructing one of them throws an exception. #3720
    • Removed a non-Standard operator basic_istream >> setfill(c). #3725
    • Fixed linker errors when linking x64 object files into ARM64EC programs. #3732
      • We backported this fix to VS 2022 17.6.6 and VS 2022 17.7.
    • Fixed the debug mode check in cartesian_product_view::size() to always accept empty views. #3733
    • Fixed formatter<char, wchar_t> to format the char as a character instead of an integer. #3723
    • The STL now avoids dragging in the non-reserved name ISA_AVAILABILITY. #3721
    • Fixed chrono::hh_mm_ss formatting to accept values of 24 hours or more. #3727
    • Changed the STL's usage of compiler-specific custom attributes to further defend against macros. #3760
    • Fixed condition_variable_any::wait_until() to handle time_points with unsigned representations instead of waiting forever. #3761
    • Fixed counting_semaphore to add compile-time enforcement of the Standard's mandates. #3747
    • Fixed a bug, affecting UWP apps only, where locking a mutex could throw a bogus exception. #3763
    • Fixed the signatures of char_traits member functions to exactly match the Standard. #3739
      • This Standardese was updated by N2349 in C++11.
    • Fixed compiler errors when visit_format_arg() is called with highly unusual visitors. #3787
    • Fixed incorrect output when format() is asked to format a floating-point value in the alternate form without a type specifier. #3815
    • Added a compiler bug workaround for MSVC modules, allowing <format> machinery to work with /utf-8 via import std;. #3816
    • Fixed a subtle bug affecting constexpr basic_string's copy assignment operator, where it wasn't starting element lifetimes for the unused capacity. #3712 #3819
    • Fixed Clang compiler errors when calling function::target<FunctionType>() on const function objects. #3844
      • This is an obscure corner case, because such calls are guaranteed to return null.
    • Fixed compiler errors when using array<T, 0> in constexpr contexts. #3863
    • Improved function call operator overload resolution for the bind(), bind_front(), and bind_back() function objects. #3775
    • Fixed iostreams with imbued locales to print infinities and NaNs correctly. #3868 #3877
    • Fixed incorrect noexcepts within the implementations of filesystem::current_path(), filesystem::current_path(error_code&), read_symlink(const path&), and read_symlink(const path&, error_code&). #3869 #3881
    • Fixed shared_ptr<void> to not be constructible from void*. #3873
    • Fixed a complicated modules scenario by removing #pragma once from all STL headers. #3895
      • #pragma once is no longer needed to improve throughput because modern compilers automatically detect the idempotency guard idiom.
    • Fixed <stacktrace>'s internal use of snprintf() in extreme situations. #3916
    • Fixed an extremely obscure runtime correctness bug in basic_string's copy assignment operator, specific to non-equal propagate_on_container_copy_assignment allocators. #3862
    • Fixed ASan annotations in basic_string::replace(). #3884
    • Fixed ASan annotations in basic_string::assign() and basic_string::resize_and_overwrite(). #3956
  • Improved performance:
    • Changed some helper member functions to be static, slightly improving debug codegen. #3755
    • mutex and condition_variable now avoid virtual function calls within their implementations. #3770
    • Optimized steady_clock::now() when QueryPerformanceFrequency() is exactly 24 MHz, which is very common for ARM64. #3832
    • Optimized filesystem::path::lexically_normal(). #3850
    • basic_string, basic_stringbuf, basic_syncbuf, deque, and vector now take advantage of allocators that provide allocate_at_least(). #3864 #3891
    • Optimized <format> slightly. #3826
    • Optimized bitset::to_string(). #3838 #3904
    • Added an attribute to as_const(), to_integer(), and to_underlying() that allows the MSVC compiler to intrinsically implement them without emitting function calls. #3664
    • Made a tiny tweak to valarray (access the stored size directly instead of via calling size()) to improve debug codegen. #3968
  • Improved throughput:
    • Moved machinery: #3719
      • Moved integer_sequence, make_integer_sequence, index_sequence, make_index_sequence, and index_sequence_for from <type_traits> to <utility>, which is where the Standard provides them.
      • Moved allocator_arg, allocator_arg_t, uses_allocator, and uses_allocator_v so that they're dragged in by slightly fewer headers. (The Standard provides them in <memory>.)
    • Some headers now avoid including <limits>. #3777
    • In C++17 mode and later, improved Clang throughput for an internal helper wrapping is_same_v. #3933
  • Enhanced behavior:
    • Added precondition checking in debug mode to the iota_view(value) constructor. #3731
    • Improved precondition checking in debug mode for barrier. #3757
    • Fixed static analysis warnings. #3734 #3743
      • Note: The STL has always attempted to be /W4 /analyze clean, but does not yet attempt to be clean with respect to all additional static analysis rulesets.
    • Strengthened the exception specifications for:
      • Internal <ranges> machinery used in join_view iterators and lazy_split_view. #3762
      • basic_string_view::compare(const charT*). #3738
      • Constructors of locale::facet and related base classes. #3855
      • Many functions in <complex>. #3880
      • Many functions in <random>, some functions in <valarray>, and 3-arg hypot() in <cmath>. #3887
    • The STL now avoids conflicting with non-Standard macros of reserved names that were defined by old versions of the ICU library. #3776
    • Updated stdext::checked_array_iterator and stdext::unchecked_array_iterator: #3818
      • Added constness conversions.
      • Deprecated these iterators, which have been superseded by std::span and gsl::span.
    • Added "lifetimebound" attributes to minmax and ranges::minmax, allowing MSVC code analysis and Clang -Wdangling to detect dangling references in improper usage. #3831
    • Improved how views::cartesian_product detects ranges with maximum sizes that are known at compile time. #3839
    • Improved how parallel algorithms perform compile-time iterator type checking. #3899
    • The STL now calls abort() instead of terminate() for unrecoverable conditions, when the Standard doesn't require terminate() to be called. #3906 #3909
    • Improved the visualizer for vector<char> and the other character types. #3772
    • Improved the visualizer for mutex and recursive_mutex. #3848
    • Updated chrono::duration_cast() to use if constexpr, improving debug codegen. #3958
  • Improved test coverage:
    • Added properly functioning test coverage for ranges::owning_view. #3753
    • Added test coverage for calling tellg() while reading an LF file in text mode. #3773 #3841
    • Added test coverage for LWG-2295 Locale name when the provided Facet is a nullptr. #3823
    • Added test coverage for LWG-2682 filesystem::copy() won't create a symlink to a directory. #3827
    • Updated tests to use lvalue references for the LHS of is_assignable_v and is_nothrow_assignable_v. #3898
    • Added more tests for views::as_const, views::stride, and views::zip. #3920
    • Test code now consistently uses override to avoid mistakes, following the same convention as product code. #3934
    • Fixed precondition violations in is_permutation() tests. #3967
    • Fixed precondition violations in regex_iterator and regex_token_iterator tests. #3990
  • Code cleanups:
    • Removed compiler bug workarounds. #3722 #3769 #3866 #3939
    • Improved SFINAE to follow modern conventions. #3736
    • Various cleanups (described in detail in the PRs, not repeated here). #3758 #3759 #3765 #3768 #3912 #3927 #3935
    • Removed comments that were citing proposed resolutions for LWG issues, now that those issues have been officially resolved by the June 2023 meeting. #3784 #3785
    • Marked internal machinery as [[noreturn]]. #3865 #3882
    • Removed unnecessary typename keywords in C++20 mode and later. #3892 #3893 #3894
    • Improved type safety by using an enum class for internal machinery within <condition_variable>, <mutex>, and <thread>. #3897
    • Improved the consistency of code that should never be called. #3905
    • Removed unused code. #3936
    • Improved the clarity and maintainability of basic_string's implementation. #3862
    • Deprecated the non-standard <cvt/meow> headers and their provided character encoding conversion machinery. #3924
  • Improved documentation:
    • Added comments where the Standard requires terminate() to be called. #3907
    • Improved the consistency of preprocessor comments. #3900 #3951
  • Infrastructure improvements:
    • Modernized code format validation to use <print>. #3919
    • Updated dependencies. #3769 #3866 #3939
      • Updated build compiler to VS 2022 17.8 Preview 1.
      • Updated Boost.Math to 1.83.0. #3952
      • Updated Clang to 16.0.5.
      • Updated Python to 3.11.4.
  • Build system improvements:
    • Added CMakePresets.json to simplify the process of building the repo. #3730 #3930
  • Updated _MSVC_STL_UPDATE. #3742 #3851 #3918