Skip to content

VS 2022 17.2

Compare
Choose a tag to compare
@StephanTLavavej StephanTLavavej released this 09 Mar 05:25
· 1186 commits to main since this release
4bb41db
  • Merged C++20 Defect Reports:
    • P2216R3 #2221 std::format Improvements
    • P2418R2 #2323 Add Support For std::generator-like Types To std::format
    • With a final bit of work to implement an integer-class type (per P1522R1) for iota_view, declare <ranges> and <format> stable and make them fully available under /std:c++20. #2518
  • Merged C++23 features:
  • Merged LWG issue resolutions:
    • LWG-2762 #2376 unique_ptr operator*() should be noexcept
    • LWG-2774 #2098 std::function construction vs assignment
    • LWG-3146 #2409 Excessive unwrapping in std::ref/cref
    • LWG-3392 #2421 ranges::distance() cannot be used on a move-only iterator with a sized sentinel
    • LWG-3470 #2414 convertible-to-non-slicing seems to reject valid case
    • LWG-3471 #2567 polymorphic_allocator::allocate does not satisfy Cpp17Allocator requirements
    • LWG-3480 #2340 directory_iterator and recursive_directory_iterator are not C++20 ranges
    • LWG-3519 #2208 Incomplete synopses for <random> classes
    • LWG-3543 #2424 Definition of when counted_iterators refer to the same sequence isn't quite right
    • LWG-3557 #2406 The static_cast expression in convertible_to has the wrong operand
    • LWG-3563 #2426 keys_view example is broken
    • LWG-3574 #2410 common_iterator should be completely constexpr-able
    • LWG-3580 #2417 iota_view's iterator's binary operator+ should be improved
    • LWG-3589 #2425 The const lvalue reference overload of get for subrange does not constrain I to be copyable when N == 0
    • LWG-3590 #2404 split_view::base() const & is overconstrained
    • LWG-3591 #2411 lazy_split_view<input_view>::inner-iterator::base() && invalidates outer iterators
    • LWG-3592 #2411 lazy_split_view needs to check the simpleness of Pattern
    • LWG-3593 #2448 Several iterators' base() const & and lazy_split_view::outer-iterator::value_type::end() missing noexcept
    • LWG-3595 #2410 Exposition-only classes proxy and postfix-proxy for common_iterator should be fully constexpr
    • LWG-3598 #2560 system_category().default_error_condition(0) is underspecified
    • LWG-3610 #2542 iota_view::size sometimes rejects integer-class types
    • LWG-3612 #2586 Inconsistent pointer alignment in std::format
    • LWG-3618 #2566 Unnecessary iter_move for transform_view::iterator
    • LWG-3621 #2543 Remove feature-test macro __cpp_lib_monadic_optional
    • LWG-3648 #2587 format should not print bool with 'c'
    • LWG-3654 #2528 basic_format_context::arg(size_t) should be noexcept
    • LWG-3657 #2564 std::hash<std::filesystem::path> is not enabled
    • LWG-3660 #2549 iterator_traits<common_iterator>::pointer should conform to [iterator.traits]
    • LWG-3661 #2544 constinit atomic<shared_ptr<T>> a(nullptr); should work
  • Merged proposed resolutions for LWG issues (not yet accepted for the C++ Working Draft, but we've chosen to implement this speculatively):
  • Fixed bugs:
    • Fixed Clang compiler errors when using ranges::join_view. #2352
    • Fixed several runtime correctness bugs in std::string. #2305
    • Fixed a memory leak affecting a specific scenario in P0408R7 Efficient Access To basic_stringbuf's Buffer. #2361
    • Each call to ranges::clamp now correctly performs at most three projections. #1898
    • The STL no longer rejects Clang in CUDA mode, nor the cl /showIncludes /D__CUDACC__ ... command used by CUDA's msbuild integration to gather dependencies. #2075
    • Fixed allocator::is_always_equal to be deprecated, not removed, in C++20 mode. (It was deprecated by LWG-3170.) #2423
    • Fixed begin()/end() crashing for empty valarrays, which also affected range-based for-loops. #2435
    • Fixed regression in ranges::distance (from LWG-3392 which broke ranges::distance(some_array, s)) by speculatively implementing LWG-3664. #2522
    • Fixed basic_string::resize_and_overwrite() to no longer emit "warning C4018: signed/unsigned mismatch" when given certain user-defined function objects. #2525
    • Increased __cpp_lib_concepts to its final value for C++20, 202002L. #2559
      • It should have been updated in VS 2019 16.6 when P1964R2 "Replacing boolean With boolean-testable" was implemented by #565. The presence of that release (or any later release) can be detected by inspecting our implementation-specific macro _MSVC_STL_UPDATE. Coincidentally, the value of _MSVC_STL_UPDATE for VS 2019 16.6 was also 202002L.
    • Fixed numerous tiny bugs discovered by the libcxx test suite. #2499
    • Fixed a bug in <format> that sporadically caused incorrect output when formatting floating-point values in hex or scientific notation with extremely large precisions. #2569
    • Fixed a bug in <charconv> from_chars() float tiebreaking that produced incorrect results. This affected decimal strings that were at the exact midpoint of consecutive float values, within a narrow range (the smallest and largest affected values were "32768.009765625" and "131071.98828125"), where the tiebreaker rule wanted to round to "even" and "even" happened to be "down", but the implementation incorrectly rounded "up". (double was unaffected.) #2366
    • promise<T> now compiles when !is_default_constructible_v<T>. #2568
    • Moving from an optional<const T> now behaves like moving from a const T: it selects T's copy constructor. #2460
    • Fixed a bug in <format> that incorrectly accepted volatile arguments; the Standard currently says that they should be rejected. #2579
  • Improved performance:
    • Optimized rotl() and rotr() in <bit> for 32-bit and 64-bit integers by using compiler intrinsics. #2369
    • reverse_copy()'s vectorized implementation is now activated (for eligible types) in all Standard modes. Previously, only the C++14/17 modes activated this optimization; C++20/23 modes unintentionally used the plain implementation (correct but slower). #2416
    • Improved codegen for gcd() and lcm(). #2343
    • Improved <format> performance when the execution character set is self-synchronizing. For example, code page 1252 "ANSI Latin 1; Western European (Windows)" activates this optimization. The /utf-8 compiler option also activates this optimization. #2493
    • Improved codegen for generate_canonical. #2498
  • Improved throughput:
    • Used if constexpr instead of tag dispatch in:
      • Optimizations in find(). #2380
      • experimental::filesystem::directory_iterator. #2478
      • basic_string(first, last). #2480
  • Enhanced behavior:
    • Fixed new warnings emitted by Clang 13: -Wdeprecated-copy (in product and test code) and -Wunused-but-set-variable (in test code only). #2266
    • Added ASan (Address Sanitizer) annotations to <vector>, allowing additional errors to be detected. #2071 #2420 #2464 #2508
    • Added a debug assertion to allocator::deallocate(); passing a null pointer with a non-zero size is an error. #2412
    • For supply chain security, replaced checked-in OBJ files (generated by an internal tool aliasobj) with the linker's /ALTERNATENAME option (which is strictly more reproducible, although not officially documented). #2381
      • In certain scenarios involving separately compiled third-party libraries, this can cause "unresolved external symbol" linker errors. See issue #2655 for an explanation and workarounds.
  • Improved documentation:
    • Clarified the messages emitted by <format> and <ranges>. #2382
    • Added a comment explaining how LWG-3632 "unique_ptr 'Mandates: This constructor is not selected by class template argument deduction'" was already implemented. #2548
  • Improved test coverage:
    • Added test cases for the _BitScanForward optimization used by countr_zero() on older CPUs. #2337
    • Added tests for gcd() and lcm(). #2507
    • Added test coverage for deduplicated (topologically sorted) header units. #2516 #2563
    • Updated the libcxx test suite. #2499
  • Code cleanups:
    • Removed compiler bug workarounds. #2338 #2351 #2357 #2474 #2496
    • Updated test code to directly pass a format string to printf(), allowing the compiler to check it. #2346
    • Cleaned up clang-formatting. #2356
    • Changed the <charconv> test headers to use include guards, for closer alignment with libc++. #2372
    • Improved the clarity of vectorized algorithm implementations by replacing the magic numbers 27 and 78. #2377
    • Improved consistency by always saying friend constexpr instead of the reverse order. #2419
    • Simplified <ratio>'s implementation by using constexpr functions instead of template metaprogramming. #2450
    • Simplified an internal function for opening files. #2095
  • Infrastructure improvements:
    • Updated dependencies. #2474 #2496 #2514
      • Updated build compiler to VS 2022 17.1 Preview 5 (now required).
      • Updated Clang to 13.0.0 (now required).
      • Updated CMake to 3.22 (now required).
      • Updated Python to 3.10.2.
    • Added scripts to set INCLUDE, LIB, and PATH after building the repo. #2578
    • Azure Pipelines now uploads test logs as artifacts, making it easier to investigate test failures when lengthy command lines, compiler output, or runtime output are truncated in the web UI. #2575
  • Updated _MSVC_STL_UPDATE. #2374 #2455 #2519 #2602