Skip to content

VS 2022 17.0

Compare
Choose a tag to compare
@StephanTLavavej StephanTLavavej released this 09 Mar 05:24
· 1480 commits to main since this release
a9321cf
  • Merged C++20 Defect Reports:
    • P2325R3 #2012 Views Should Not Be Required To Be Default Constructible
    • P2328R1 #2038 join_view Should Join All views Of ranges
    • P2367R0 #2026 Remove Misuses Of List-Initialization From Clause 24 Ranges
  • Enabled C++20 features for Clang: #2064
  • Merged C++23 features:
    • P0401R6 #2036 Providing Size Feedback In The Allocator Interface
    • P1048R1 #1950 is_scoped_enum
    • P1132R7 #1998 out_ptr(), inout_ptr()
    • P1679R3 #1478 contains() For basic_string/basic_string_view
    • P1682R3 #1828 to_underlying() For Enumerations
    • P1951R1 #2009 Default Template Arguments For pair's Forwarding Constructor
    • P1989R2 #2000 Range Constructor For string_view
    • P2162R2 #2006 Inheriting From variant
    • P2166R1 #1995 Prohibiting basic_string And basic_string_view Construction From nullptr
      • This is a common source-breaking change - code that previously had undefined behavior at runtime will now be rejected with compiler errors.
    • P2186R2 #2010 Removing Garbage Collection Support
  • Merged LWG issue resolutions:
    • LWG-3430 #1968 std::fstream & co. should be constructible from string_view
    • LWG-3494 #1877 Allow ranges to be conditionally borrowed
    • LWG-3502 #1878 elements_view should not be allowed to return dangling references
    • LWG-3518 #2080 Exception requirements on char trait operations unclear
    • LWG-3533 #1993 Make base() const & consistent across iterator wrappers that support input_iterators
    • LWG-3541 #1992 indirectly_readable_traits should be SFINAE-friendly for all types
    • LWG-3548 #2007 shared_ptr construction from unique_ptr should move (not copy) the deleter
    • LWG-3553 #1990 Useless constraint in split_view::outer-iterator::value_type::begin()
    • LWG-3555 #1989 {transform,elements}_view::iterator::iterator_concept should consider const-qualification of the underlying range
  • Merged partial LWG issue resolutions:
    • P2259R1 #1939 Repairing Input Range Adaptors And counted_iterator
      • The counted_iterator part is implemented; the input range adaptors part is not yet implemented.
  • Fixed bugs:
    • Fixed time_put::do_put to avoid crashing when the invalid parameter handler has been changed to not end execution. #1563
    • Fixed a compiler error in ranges::take_view. #1844
    • Fixed improper partitioning of forward ranges in the parallel algorithms. #1753
    • Fixed an unintentionally dllexported symbol in the import library. #1927
    • Fixed a bug in which ranges::unique_copy would fail to compile with a non-input output iterator. #1933
    • Fixed a compiler error when calling format_to() in a specialization of formatter (see #1961 for an example). #1874
    • Fixed compiler errors when calling views::drop and views::take with types that aren't integers, but are convertible to integers (e.g. integral_constant). #1958
    • Fixed a compiler error when calling constexpr vector::emplace(position, args...). #1962
    • Fixed jthread to provide native_handle(). #1966
    • Fixed filesystem::remove() to delete read-only files, as required by the Standard. #1559
    • Fixed mersenne_twister_engine: #1631
      • Fixed the seeding algorithm to follow N4892 [rand.eng.mers]/8, avoiding an all-zero state. (This is a runtime special case.)
      • Fixed the engine's behavior when m == n or n == 1. (This is a compile-time special case, which doesn't affect mt19937 and mt19937_64 at all.)
      • Fixed operator<<() to avoid printing a trailing space after the engine's textual representation.
    • Fixed <chrono> to adjust for leap seconds when formatting file_time. #1879
    • Fixed chrono::from_stream() to allow a year and a day-of-year to be parsed to a time_point. #1940
    • Fixed filesystem::u8path() to accept char8_t sources. #1943
    • Fixed <chrono> to parse subseconds for time_points. #1987
      • Also fixed the parsing of local_time with a UTC offset.
    • Fixed <chrono> formatting to correctly estimate string widths (see N4892 [format.string.std]/9). #2017
    • Fixed a major regression in the _ITERATOR_DEBUG_LEVEL == 2 machinery, where a multithreaded program in debug mode could crash when one thread is modifying a container and another thread is destroying iterators. #2060
      • This regression affected all Standard modes (C++14/17/20/23) and was introduced by #1546 in VS 2019 16.10.
      • Fixed in both VS 2019 16.11.4 and VS 2022 17.0.
    • Fixed a compiler error in pmr::map<K, pair<A, B>>::operator[]. #2023
    • Fixed compiler errors in basic_string's getline() and operator>>() caused by the source-breaking change C++23 P2266R1 "Simpler Implicit Move", first implemented in Clang 13. #2025
    • bit_ceil() now enforces its precondition during constexpr evaluation, as required by the Standard. #2041
    • clog is no longer tied to cout, and similarly for wclog and wcout, following the Standard. #2056
    • In <ranges>, when filter_view, drop_view, drop_while_view, and reverse_view store a cached position into an underlying view, they now properly invalidate that cached position when the underlying view is moved from. #1931
  • Improved performance:
    • Slightly improved debug codegen for vector<bool>, basic_string, and map/multimap/set/multiset's empty() member functions. #1836
    • Fixed bloated codegen for <format>. #1874
    • Dramatically improved the performance of std::find() and std::count() for vector<bool>, with measured speedups between 19x and 26x (times, not percent). #1131
    • Extended our memcmp/memcpy/memchr optimizations to ranges with contiguous iterators and unreachable sentinels. #1810
    • <format> now detects when it's writing to a back_insert_iterator for a basic_string or a vector, and performs a faster call to insert() at the end() of the container. #1894
    • std::byte now activates the "trivially swappable" optimization in reverse() and variant::swap(), so it'll have the same performance as unsigned char. #2044
    • Extended the vectorization optimization in std::swap_ranges() to ranges::swap_ranges(), and enhanced it to work for arbitrary contiguous iterators. #2048
    • Reduced debug codegen size; an internal assertion macro was emitting completely unused, potentially long strings for function names. #2054
  • Improved throughput:
    • <format> and <chrono> now avoid including <array>. #2031
  • Enhanced behavior:
    • Added a visualizer for source_location. #1837
    • Added [[nodiscard]] to the stoi() family of functions in <string> and to various functions in <locale> (collate member functions, has_facet(), and the isalnum() and tolower() families). #1809
    • Added a debug mode precondition check to forward_list::splice_after(). #2057
    • Added visualizers for bind_front(), u8string (and its iterators), default_sentinel_t, unreachable_sentinel_t, ranges::empty_view, ranges::single_view, ranges::iota_view (and its iterator/sentinel), ranges::ref_view, thread, thread::id, jthread, and filesystem::path. #1856
  • Improved test coverage:
    • Added test coverage for our implementation-specific guarantees that span and basic_string_view are trivially copyable; P2251 may eventually Standardize these guarantees. #2015
    • Fixed the ranges test machinery to properly specialize std::basic_common_reference; it was unintentionally relying on identical bugs in MSVC and Clang, but EDG correctly diagnosed that the code was non-Standard. #2013
    • Fixed a test (for the abs() overloads in <cmath> and <cstdlib>) that unintentionally hadn't been running in our new GitHub test harness. #2070
  • Code cleanups:
    • Removed compiler bug workarounds. #1759 #1778 #1920
    • Removed unnecessary C casts. #1843
    • The STL now uses Standard _Pragma instead of non-Standard __pragma (when possible) to internally suppress warnings. #1342
    • <format> now uses _First/_Last parameter names (instead of _Begin/_End) to be consistent with the rest of the STL. (The connotations are that first/last refers to an arbitrary range that might be a subrange, while begin/end refers to an entire container/view.) #1951
    • Removed comments that were citing proposed resolutions for LWG issues, now that those issues have been officially resolved by the June 2021 virtual plenary meeting. #1967
    • Improved vector's implementation, also using if constexpr to simplify code. #1771
    • Simplified <format>'s implementation of type-erased argument storage. #1907
    • Filed LWG-3566 "Constraint recursion for operator<=>(optional<T>, U)" and updated our implementation's comment accordingly. #2011
    • Simplified the backwards loop in char_traits::move(). #2055
    • Marked all overriding functions with override, and removed redundant virtual keywords. #2069
    • REMOVED THE "SHOUTY COMMENT BANNERS" LIKE // CLASS TEMPLATE vector; SEE #306 FOR THE RATIONALE. #2074
    • Removed an unnecessary check for self-assignment in the compile-time implementation of char_traits::move(). #2083
  • Infrastructure improvements:
    • Updated dependencies. #1884 #1920 #1953 #2014 #2064 #2081
      • Updated build compiler to VS 2022 17.0 Preview 2 (now required).
      • Updated Clang to 12.0.0 (now required).
      • Updated CMake to 3.20 (now required).
      • Updated Python to 3.9.6.
      • Updated vcpkg for Boost 1.76.0 (now required).
  • Build system improvements:
  • Updated _MSVC_STL_UPDATE. Also updated _MSVC_STL_VERSION to 143 for the VS 2022 release series. #1897 #1955 #2035 #2091