Skip to content

VS 2022 17.1

Compare
Choose a tag to compare
@StephanTLavavej StephanTLavavej released this 09 Mar 05:24
· 1375 commits to main since this release
3c2fd04
  • Merged C++20 Defect Reports:
  • Merged C++23 features:
  • Merged LWG issue resolutions:
    • P2259R1 #2059 Repairing Input Range Adaptors And counted_iterator
      • Completed by implementing the input range adaptors part.
    • LWG-3422 #2260 Issues of seed_seq's constructors
    • LWG-3506 #1994 Missing allocator-extended constructors for priority_queue
    • LWG-3520 #2200 iter_move and iter_swap are inconsistent for transform_view::iterator
    • LWG-3522 #1994 Missing requirement on InputIterator template parameter for priority_queue constructors
    • LWG-3527 #2194 uses_allocator_construction_args handles rvalue pairs of rvalue references incorrectly
    • LWG-3528 #2160 make_from_tuple can perform (the equivalent of) a C-style cast
    • LWG-3536 #2037 Should chrono::from_stream() assign zero to duration for failure?
    • LWG-3546 #1991 common_iterator's postfix-proxy is not quite right
    • LWG-3549 #2198 view_interface is overspecified to derive from view_base
    • LWG-3554 #2261 chrono::parse needs const charT* overloads
  • Fixed bugs:
    • Fixed <complex> exp() and polar() for infinity and NaN inputs. #1584
    • Fixed compiler errors when comparing common_iterators of different types for equality. #2066
    • Attempting to actually call declval() now emits a static_assert citing the paragraph of the Standard that forbids this. (Previously, declval() was declared but not defined, which was too permissive.) #2101
    • Fixed basic_streambuf::seekoff() and basic_streambuf::seekpos() to work with custom pos_types. #2121
    • Restored our guarantee beyond the Standard that string_view is trivially move constructible. #2128
      • This fixed a regression that was introduced by #2000 implementing P1989R2 Range Constructor For string_view in VS 2022 17.0.
    • Fixed a bug where vector and string would terminate via noexcept instead of throwing length_error as desired when a size_t would be truncated to an allocator's narrower size_type. #2139
    • <istream> and <ostream> now properly catch and rethrow internal IO exceptions. #2033
    • Fixed <format> to correctly print hexfloats with large precisions. #2157
    • Fixed compiler errors when using constexpr vectors with certain user-defined allocators. #2161
    • Fixed silent bad codegen in ranges::stable_sort(), where for certain inputs it would neither sort nor permute the range. ranges::inplace_merge() was also affected. #2188
    • subtract_with_carry_engine's textual representation is now correct. #2088
    • Fixed a deadlock in the overload of condition_variable_any::wait_until taking stop_token. #2220
    • u8streampos, u16streampos, and u32streampos are now declared by <iosfwd> as required by the Standard after P0482R6 and P1148R0 were accepted. #2223
    • Fixed ARM64EC compiler errors in <limits>. #2306
    • Fixed heap corruption in fstream when calling putback() followed by close(). #2189
    • Fixed views::reverse to work properly with ranges::reverse_view lvalues. #2313
    • Fixed a bug where the STL's DLL was using Windows Vista's APIs for critical sections and condition variables, instead of the more efficient APIs that were introduced in Windows 7. This was specific to /MD (dynamic release) and the STL's GitHub CMake build system; it did not affect the legacy build system that's currently used for official builds of the MSVC toolset. #2314
    • Fixed a bug affecting older CPUs where the STL generated the newer tzcnt instruction instead of the fallback bsf instruction. This affected <bit>'s countr_zero() and countr_one(), <numeric>'s gcd() and lcm(), and vector<bool>'s optimized implementations of find() and relational/spaceship operators. #2333
    • Fixed minor conformance issues in basic_string. These changes were specified by P1148R0 "Cleaning Up [strings]", which was almost a pure rewording paper without normative impact. Oops! #2222
    • Fixed ranges::find_end() to return correct values for bidirectional common ranges. #2270
    • Fixed compiler errors affecting ranges::sort(), ranges::search(), and other ranges machinery. #2290
    • Fixed array<T, 0>, allowing it to compile when T is not default constructible. #2296
    • Fixed allocator::allocate_at_least() which was improperly annotated with __declspec(allocator). #2328
  • Improved performance:
    • Optimized steady_clock::now() when QueryPerformanceFrequency() is exactly 10 MHz, which is very common for modern PCs. #2086
    • Improved codegen for x86 atomic loads. #2110
    • Optimized the fallback implementation of popcount(), which is used when compiler intrinsics are unavailable (and is also used at compile time). #2079
    • Slightly improved codegen when <format> prints a pointer in hexadecimal. #2097
    • Optimized <ranges> non-propagating-cache for trivially destructible types. #2118
    • Improved ARM64 codegen for popcount(), using compiler intrinsics. #2127
    • Extended the memcpy(), memmove(), and memcmp() optimizations in various algorithms to handle more types. #2158
    • Significantly improved the performance of bitset::count() by using the same machinery as popcount(). #2201
    • Also improved the performance of std::count() for vector<bool> by using popcount() machinery in a more optimizer-friendly way. #2203
    • weak_ptr's converting constructors now avoid locking except when necessary to ensure correctness in virtual inheritance scenarios. #2282
      • For example, converting weak_ptr<T> to weak_ptr<const T> now avoids locking.
    • Removed a duplicated assignment in filesystem::create_directories(). #2304
    • Optimized is_permutation() for reversed sequences. #2043
  • Improved throughput:
    • Replaced tag dispatch with if constexpr in container copy/move assignment. #2217
    • <format> now avoids instantiating vformat() unless and until it's called. #2331
  • Enhanced behavior:
    • Changed numeric_limits<long double>::max_digits10 to handle both 64-bit and 80-bit long double, by restoring the original logic that was used before VS 2017 15.8.
      • Note: 80-bit long double remains unsupported by MSVC.
    • C++ headers now emit clear #error messages when they're compiled as C. #2148
      • This applies to both the "C++ library headers" like <vector> and the "C++ headers for C library facilities" like <cstdio>.
    • Improved the wording of binary_semaphore's debug check messages. #2293
  • Improved documentation:
    • Cited LWG-3581 "The range constructor makes basic_string_view not trivially move constructible" in our implementation of its proposed resolution. #2175
    • Removed comments that were citing GH-489, now that LWG-3530 "BUILTIN-PTR-MEOW should not opt the type out of syntactic checks" has been officially resolved by the June 2021 virtual plenary meeting. #2186
  • Improved test coverage:
    • Removed a constructible_from test case that was invalidated by recent changes to the Core Language. #2107
    • Fixed a test for next_permutation() and prev_permutation(); the algorithms were fine, but the test never worked and was never called. #2137
    • Fixed the test harness to handle non-English Visual Studio installations running on Windows with non-UTF-8 encodings. #2145
    • Added /arch:AVX2 to the matrix of compiler options that's used when testing <bit>. #2150
    • Skipped more flaky tests in the legacy tr1 test suite. #2202
    • Fixed flaky tests in the legacy tr1 test suite that were generating collisions between temporary filenames. #2210
    • Fixed test failures on Windows 11. #2265
    • Fixed <chrono> formatting test failures related to locale-dependent time zone abbreviations. #2231
  • Code cleanups:
    • Moved a helper struct from a central internal header to <optional>. #2117
    • Cleaned up comments and clang-formatting. #2136
    • Removed a spurious overload of operator>>(basic_istream&&, basic_string&). This didn't affect correctness, but it was neither necessary nor depicted by the Standard. #2138
    • Cleaned up various things, notably simplifying exception_ptr's operators for C++20 and emitting a clear error message when compiling <stdatomic.h> as C. #2140
    • Removed unnecessary code in <cctype> that was attempting to defend against macroized isalnum etc. #2147
    • Removed an unnecessary reinterpret_cast, and changed some reinterpret_casts from void* to T* to use static_cast instead. #2096
    • Removed an unnecessary definition of our internal macro _HAS_CXX23 from our central internal header yvals_core.h. #2226
    • Removed comments that were citing proposed resolutions for LWG issues, now that those issues have been officially resolved by the October 2021 virtual plenary meeting. #2269
    • Removed unnecessary (void) casts now that MSVC emits fewer spurious warnings about unreferenced parameters. #2280
    • Removed compiler bug workarounds. #2327
  • Infrastructure improvements:
    • Updated dependencies. #2115 #2204 #2277 #2327
      • Updated build compiler to VS 2022 17.1 Preview 1.
      • Updated CMake to 3.21 (now required).
      • Updated Python to 3.10.0.
    • Replaced vcpkg with boostorg/math 1.77 in standalone mode. #2151
  • Updated _MSVC_STL_UPDATE. #2183 #2233 #2321