-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Changelog
- VC Redist Lockdown
- Expected in VS 2022 17.9 Preview 2
- Expected in VS 2022 17.9 Preview 1
- Expected in VS 2022 17.8 Preview 3
- VS 2022 17.8 Preview 2 - latest preview version with STL changes, see the VS 2022 Preview Release Notes
- VS 2022 17.8 Preview 1
- VS 2022 17.7 - latest production version, see the VS 2022 Release Notes
- VS 2022 17.6
- VS 2022 Changelog
- VS 2019 Changelog
C++20 and C++23 features generally require the /std:c++20
and /std:c++latest
compiler options, respectively.
To reduce the frequency of required reboots when updating VS (and VS Previews), we "lock down" the Visual C++ Redistributable containing the STL's msvcp140.dll
. (Most of the STL is header-only, so most changes are unaffected.) Approximately twice a year, specific VS Previews will be "unlocked", so the VC Redist will contain updated DLLs. VS 2022 17.8 Preview 3 will be the next unlocked redist, then the next Long-Term Support release will be unlocked (it can be Preview 1 if we need).
- Fixed bugs:
- Fixed
allocate_shared()
for unbounded arrays to handle fancy pointers. #4074
- Fixed
- Improved test coverage:
- Fixed the ASan-Daily-CI pipeline. #4075
- Merged C++23 features:
-
P0009R18 #3972 #4037
<mdspan>
-
P1169R4 #4053
static
operator()
- This updates CTAD (class template argument deduction) for
std::function
andpackaged_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.
- This updates CTAD (class template argument deduction) for
-
P0009R18 #3972 #4037
- Merged partial C++23 features:
- Merged LWG issue resolutions:
- Fixed bugs:
- Fixed incorrect results from iostreams floating-point parsing (e.g.
"1e-07"
was incorrectly parsed as1e-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 withany
. #4013 - Fixed incorrect behavior when self-move-assigning
any
, and fixed compiler errors inany
involving incomplete types. #3965 - Fixed
deque
to preserve its internal invariants when taking advantage of allocators that provideallocate_at_least()
. #4017 - Fixed bugs in
basic_string
's copy assignment operator, specific to non-equalpropagate_on_container_copy_assignment
allocators, involving ASan annotations or fancy pointers. #4031 - Fixed
deque
emplace()
andinsert()
to not require elements to be swappable; this change also improved performance. #4022 - Fixed
get()
and comparison operators to handle program-defined specializations ofarray
. #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
deque
to handle highly unusual fancy pointers. #4049 - Fixed
not_fn()
to return a perfect forwarding call wrapper in C++20 mode as required by P0356R5. #4057 - Fixed
deque::shrink_to_fit()
to avoid requiring the allocator to be default constructible. #4071
- Fixed incorrect results from iostreams floating-point parsing (e.g.
- Improved performance:
- Optimized the
copy()
,copy_n()
, andmove()
algorithms forvector<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 the
- Enhanced behavior:
- Added debug checks to
<valarray>
binary operations, verifying that the operands have the same size. #3911 - Deprecated
basic_istream
'sipfx()
/isfx()
andbasic_ostream
'sopfx()
/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_assert
s 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-bitlong double
by removing astatic_assert
that was added in 2018.-
Note: 80-bit
long double
remains unsupported by MSVC.
-
Note: 80-bit
- 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
to0
. - For example, given
template <typename T> void cats()
called withcats<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"
.
- Added debug checks to
- Improved test coverage:
- Code cleanups:
- Improved documentation:
- Improved the consistency of preprocessor comments. #3950
- Infrastructure improvements:
- Updated
_MSVC_STL_UPDATE
. #4003 #4062
- Merged C++23 features:
- Merged C++20 extension:
- The C++23 named modules
std
andstd.compat
are now available when compiling in C++20 mode. (This extension should eventually be portable to the major Standard Library implementations via an informal agreement between implementers.) #3977
- The C++23 named modules
- Fixed bugs:
- Fixed
<stacktrace>
's internal use ofsnprintf()
in extreme situations. #3916 - Fixed an extremely obscure runtime correctness bug in
basic_string
's copy assignment operator, specific to non-equalpropagate_on_container_copy_assignment
allocators. #3862 - Fixed ASan annotations in
basic_string::assign()
andbasic_string::resize_and_overwrite()
. #3956
- Fixed
- Improved performance:
- Improved throughput:
- In C++17 mode and later, improved Clang throughput for an internal helper wrapping
is_same_v
. #3933
- In C++17 mode and later, improved Clang throughput for an internal helper wrapping
- Enhanced behavior:
- Improved how parallel algorithms perform compile-time iterator type checking. #3899
- The STL now calls
abort()
instead ofterminate()
for unrecoverable conditions, when the Standard doesn't requireterminate()
to be called. #3906 #3909 - Improved the visualizer for
mutex
andrecursive_mutex
. #3848 - Updated
chrono::duration_cast()
to useif constexpr
, improving debug codegen. #3958
- Improved test coverage:
- Added more tests for
views::as_const
,views::stride
, andviews::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
andregex_token_iterator
tests. #3990
- Added more tests for
- Code cleanups:
- Removed compiler bug workarounds. #3939
- Various cleanups (described in detail in the PRs, not repeated here). #3912 #3927 #3935
- Removed unused code. #3936
- Improved the clarity and maintainability of
basic_string
's implementation. #3862 - Deprecated the non-standard
<cvt/meow>
headers and their providing character encoding conversion machinery. Users should prefer to callMultiByteToWideChar()
andWideCharToMultiByte()
. #3924
- Improved documentation:
- Infrastructure improvements:
- Build system improvements:
- Updated
_MSVC_STL_UPDATE
. #3918
- Merged C++26 features:
- Fixed bugs:
- Fixed Clang compiler errors when calling
function::target<FunctionType>()
onconst 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>
inconstexpr
contexts. #3863 - Improved function call operator overload resolution for the
bind()
,bind_front()
, andbind_back()
function objects. #3775 - Fixed iostreams with imbued locales to print infinities and NaNs correctly. #3868 #3877
- Fixed incorrect
noexcept
s within the implementations offilesystem::current_path()
,filesystem::current_path(error_code&)
,read_symlink(const path&)
, andread_symlink(const path&, error_code&)
. #3869 #3881 - Fixed
shared_ptr<void>
to not be constructible fromvoid*
. #3873 - Fixed ASan annotations in
basic_string::replace()
. #3884 - Fixed
mutex
's constructor to beconstexpr
. #3824-
Note: Programs that aren't following the documented restrictions on binary compatibility may encounter null dereferences in
mutex
machinery. You must follow this rule:When you mix binaries built by different supported versions of the toolset, the Redistributable version must be at least as new as the latest toolset used by any app component.
-
Also Note: This change was made opt-in for 17.8 by #4000 to avoid breakage for UWP apps since we failed to update the VCLibraries UWP framework package for this change in a timely manner. We expect to rectify this situation for 17.9, but in the meantime non-UWP code can opt-in by defining
_ENABLE_CONSTEXPR_MUTEX_CONSTRUCTOR
.
-
Note: Programs that aren't following the documented restrictions on binary compatibility may encounter null dereferences in
- 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 Clang compiler errors when calling
- Improved performance:
- Optimized
steady_clock::now()
whenQueryPerformanceFrequency()
is exactly 24 MHz, which is very common for ARM64. #3832 - Optimized
filesystem::path::lexically_normal()
. #3850 -
basic_string
,basic_stringbuf
,basic_syncbuf
,deque
, andvector
now take advantage of allocators that provideallocate_at_least()
. #3864 #3891 - Optimized
<format>
slightly. #3826 - Optimized
bitset::to_string()
. #3838 - Added an attribute to
as_const()
,to_integer()
, andto_underlying()
that allows the MSVC compiler to intrinsically implement them without emitting function calls. #3664
- Optimized
- Enhanced behavior:
- Updated
stdext::checked_array_iterator
andstdext::unchecked_array_iterator
: #3818- Added
const
ness conversions. - Deprecated these iterators, which have been superseded by
std::span
andgsl::span
.
- Added
- Added "lifetimebound" attributes to
minmax
andranges::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 - Strengthened the exception specifications for:
- Updated
- Improved test coverage:
- Code cleanups:
- Removed compiler bug workarounds. #3866
- 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
- Infrastructure improvements:
- Updated dependencies. #3866
- Updated build compiler to VS 2022 17.7 Preview 3.
- Updated Clang to 16.0.5.
- Updated dependencies. #3866
- Updated
_MSVC_STL_UPDATE
. #3851
- Merged LWG issue resolutions:
-
LWG-3631 #3745
basic_format_arg(T&&)
should useremove_cvref_t<T>
throughout -
LWG-3843 #3737
std::expected<T, E>::value() &
assumesE
is copy constructible -
LWG-3893 #3782 LWG-3661 broke
atomic<shared_ptr<T>> a; a = nullptr;
-
LWG-3904 #3781
lazy_split_view::
outer-iterator
'sconst
-converting constructor isn't settingtrailing_empty_
-
LWG-3631 #3745
- 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 thechar
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 handletime_point
s 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
viaimport 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 the
- Improved performance:
- Improved throughput:
- Moved machinery: #3719
- Moved
integer_sequence
,make_integer_sequence
,index_sequence
,make_index_sequence
, andindex_sequence_for
from<type_traits>
to<utility>
, which is where the Standard provides them. - Moved
allocator_arg
,allocator_arg_t
,uses_allocator
, anduses_allocator_v
so that they're dragged in by slightly fewer headers. (The Standard provides them in<memory>
.)
- Moved
- Some headers now avoid including
<limits>
. #3777
- Moved machinery: #3719
- 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.
-
Note: The STL has always attempted to be
- Strengthened the exception specifications for:
- Improved the visualizer for
vector<char>
and the other character types. #3772 - The STL now avoids conflicting with non-Standard macros of reserved names that were defined by old versions of the ICU library. #3776
- Added precondition checking in debug mode to the
- Improved test coverage:
- Code cleanups:
- Removed compiler bug workarounds. #3722 #3769
- Improved SFINAE to follow modern conventions. #3736
- Various cleanups (described in detail in the PRs, not repeated here). #3758 #3759 #3765 #3768
- 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
- Infrastructure improvements:
- Updated dependencies. #3769
- Updated build compiler to VS 2022 17.7 Preview 2.
- Updated Python to 3.11.4.
- Updated dependencies. #3769
- Updated
_MSVC_STL_UPDATE
. #3742
- Merged C++23 features:
-
P1467R9 #3583 Extended Floating-Point Types
-
Note: This means that we provide the
<stdfloat>
header containing an emptynamespace std {}
, as we don't support any optional extended floating-point types.
-
Note: This means that we provide the
-
P2093R14 #3337
<print>
: Formatted Output-
P2539R4 Synchronizing
print()
With The Underlying Stream
-
P2539R4 Synchronizing
-
P2164R9 #3472
views::enumerate
-
P2165R4 #3372 Compatibility Between
tuple
,pair
, And tuple-like Objects -
P2321R2
zip
, completed by implementing: -
P2374R4 #3561
views::cartesian_product
- P2540R1 Empty Product For Certain Views
-
P2572R1 #3629
std::format
Fill Character Allowances - P2609R3 #3486 Relaxing Ranges Just A Smidge
-
P2614R2 #3482 Deprecating
float_denorm_style
,numeric_limits::has_denorm
,numeric_limits::has_denorm_loss
-
P2652R2 #3542 Disallowing User Specialization Of
allocator_traits
-
P2655R3 #3513
common_reference_t
Ofreference_wrapper
Should Be A Reference Type -
P2736R2 #3556 Referencing The Unicode Standard
-
<format>
now understands Unicode 15.
-
- P2770R0 #3466 Stashing Stashing Iterators For Proper Flattening
-
P1467R9 #3583 Extended Floating-Point Types
- Merged partial C++23 features:
- Merged LWG issue resolutions:
-
LWG-2195 #3506 Missing constructors for
match_results
-
LWG-2309 #3469
mutex::lock()
should not throwdevice_or_resource_busy
- LWG-2381 #3364 Inconsistency in parsing floating point numbers
-
LWG-3204 #3494
sub_match::swap
only swaps the base class -
LWG-3655 #3495 The
INVOKE
operation andunion
types -
LWG-3677 #3396 Is a cv-qualified
pair
specially handled in uses-allocator construction? - LWG-3720 #3511 Restrict the valid types of arg-id for width and precision in std-format-spec
-
LWG-3733 #3496
ranges::to
misusescpp17-input-iterator
-
LWG-3734 #3503 Inconsistency in
inout_ptr
andout_ptr
for empty case -
LWG-3821 #3509
uses_allocator_construction_args
should have overload forpair-like
-
LWG-3833 #3477 Remove specialization
template<size_t N> struct formatter<const charT[N], charT>
-
LWG-3836 #3587
std::expected<bool, E1>
conversion constructorexpected(const expected<U, G>&)
should take precedence overexpected(U&&)
withoperator bool
-
LWG-3847 #3479
ranges::to
can still return views -
LWG-3851 #3517
chunk_view::
inner-iterator
missing customiter_move
anditer_swap
-
LWG-3860 #3480
range_common_reference_t
is missing -
LWG-3862 #3471
basic_const_iterator
'scommon_type
specialization is underconstrained -
LWG-3865 #3476 Sorting a range of
pair
s- This can be a source-breaking change in unusual scenarios.
-
LWG-3869 #3487 Deprecate
std::errc
constants related to UNIX STREAMS -
LWG-3870 #3475 Remove
voidify
-
LWG-3872 #3470
basic_const_iterator
should have customiter_move
-
LWG-3875 #3485
std::ranges::repeat_view<T, IntegerClass>::
iterator
may be ill-formed -
LWG-3877 #3504 Incorrect constraints on
const
-qualified monadic overloads forstd::expected
-
LWG-3887 #3589 Version macro for
allocate_at_least
-
LWG-2195 #3506 Missing constructors for
- Fixed bugs:
- Fixed the
ios_base
constants (e.g.ios_base::binary
,ios_base::failbit
,ios_base::hex
) to have the correct bitmask types. #3405 - Fixed compiler errors found with Clang 16. #3483
- Fixed
<ranges>
to avoid using list-initialization when the difference between braces and parentheses is observable. #3493 - Fixed
pmr::unsynchronized_pool_resource
to respectpmr::pool_options::max_blocks_per_chunk
when it's smaller than the default initial number of blocks per chunk. #3510 - Fixed technically undefined behavior in
<regex>
and<sstream>
found by Clang/LLVM's Undefined Behavior Sanitizer (UBSan). #3452 - Fixed compiler errors when calling
ranges::equal
with ranges involvingviews::iota
. #3551 - Fixed the STL's iterator unwrapping machinery to avoid requiring a
_Prevent_inheriting_unwrap
typedef. #3566 - Fixed spurious warnings from Clang's
-Wzero-as-null-pointer-constant
when comparing the spaceship operator's return types (partial_ordering
,weak_ordering
,strong_ordering
) with literal0
. #3581 - Fixed
bind()
function objects to have constrained function call operators, so they interact properly withis_invocable
and related scenarios. #3577 - Reverted #2654 (which affected
<future>
's use of<ppltasks.h>
in Desktop XAML apps) because it introduced anole32.dll
dependency that broke multiple scenarios. #3607- We backported this revert to VS 2022 17.6.
- Fixed
views::cartesian_product
to avoid compiler errors in pathological scenarios. #3609 - Fixed incorrect results for ranges larger than 4 GB passed to the vectorized implementations of
min_element()
,max_element()
, andminmax_element()
. #3619 - Added a compiler bug workaround for MSVC in
shared_ptr
'soperator<=>
. #3647- This avoids compiler errors when comparing
shared_ptr<const int>
toshared_ptr<void>
.
- This avoids compiler errors when comparing
- Added a space to
chrono::ambiguous_local_time
's message to exactly match the Standard. #3650 - Fixed compiler errors when formatting unusual
chrono::duration
types. #3649 - Fixed
optional::transform()
to avoid terminating when the callable object throws an exception. #3668 - Fixed
<charconv>
floating-pointfrom_chars()
to correctly handle two scenarios involving exponents with large absolute values. #3670 - Fixed iostreams floating-point parsing to produce correct results for many different scenarios. #3364
- Fixed compiler errors when importing the Standard Library Modules and calling
typeid(T).name()
. #3677 - Fixed some nasty corner cases in
cartesian_product_view
. #3678 - Fixed some issues with parsing numbers with grouping separators. #3684
- Fixed a bug that could result in
unordered_meow
containers allocating too few buckets. #3687
- Fixed the
- Improved performance:
- Slightly optimized
mutex
andrecursive_mutex
construction by avoiding a Windows API call. #3522 - Slightly optimized
unique_ptr
move assignment by avoiding an unnecessary branch. #3540 - Optimized
chrono::time_zone::to_sys
andchrono::time_zone::to_local
, with a speedup of approximately 3x (times, not percent). #3579 - Optimized
type_index::operator<=>
to avoid calling the comparison function twice. #3600 - Inserted the
VZEROUPPER
instruction at the end of every AVX2 codepath in the STL's vectorized algorithms, improving performance in non-optimized debug mode when the compiler doesn't automatically insert this instruction. #3630 - Optimized the constructors
system_error(error_code)
andsystem_error(int, const error_category&)
. #3635
- Slightly optimized
- Improved throughput:
-
<optional>
and<variant>
now include fewer headers. #3624 - Moved internal machinery into
<regex>
where it's needed. #3625 - C++20
<chrono>
now avoids including<algorithm>
. #3626 -
<compare>
now avoids including<bit>
. #3627 - Refactored a central internal header so that the rest of the STL includes fewer headers and provides less machinery beyond what's required. #3623 #3654
- Common source-breaking impact:
- Need to include
<cstdlib>
forexit
,quick_exit
, etc. - Need to include
<initializer_list>
forinitializer_list
.- Sometimes
initializer_list
is used implicitly when only braces appear in the source code.
- Sometimes
- Need to include
<functional>
forunary_function
andbinary_function
.- Note that
unary_function
andbinary_function
were deprecated in C++11 and removed in C++17, so it's best to stop using them completely.
- Note that
- Need to include
- Uncommon source-breaking impact:
- Need to include
<memory>
foraddressof
. - Need to include
<functional>
forless
,less_equal
,greater
,greater_equal
,equal_to
,not_equal_to
,plus
,minus
, andmultiplies
.
- Need to include
- Common source-breaking impact:
- When the STL needs to call
swap
via Argument-Dependent Lookup, it now does so directly; the internal helper function_Swap_adl
has been removed. #3700
-
- Enhanced behavior:
- Silenced CodeQL warnings. #3489 #3585
- Silenced occurrences (in
bitset::reference
and test code) of MSVC's new off-by-default warning C5267 for deprecated implicit copy constructors/assignment operators. #3497 - Enabled
<source_location>
for Clang. #3584 - Removed the non-Standard
xtime
type from<chrono>
. #3594 - Added
static_assert
s to containers, container adaptors, andallocator
to improve the error messages when they're given non-object types. #2436 #3660-
allocator<void>
is still permitted as a special case.
-
- Improved test coverage:
- Added test coverage with Clang/LLVM's Undefined Behavior Sanitizer (UBSan). #3452
- Added more tests for
views::empty
,views::iota
,views::istream
,views::repeat
, andviews::single
. #3553 - Fixed nonconformant code in the test for Standard Library Header Units and Modules. #3588
- Added test coverage for C++23's customization point objects. #3610
- Added more tests for
ranges::ref_view
,ranges::subrange
,views::common
,views::filter
,views::join
,views::reverse
, andviews::transform
. #3612
- Code cleanups:
- Removed many compiler (and CMake) bug workarounds. #3490 #3499 #3651 #3711
- Various cleanups (described in detail in the PRs, not repeated here). #2116 #3406 #3523 #3524 #3525 #3526 #3527 #3528 #3529 #3530 #3531 #3532 #3533 #3539 #3543 #3547 #3598 #3633 #3639 #3658
- Removed comments that were citing proposed resolutions for LWG issues, now that those issues have been officially resolved by the February 2023 meeting. #3554
- Simplified code by calling
fill_n()
instead offill()
when possible. #3578
- Improved documentation:
- Added documentation about the STL's import library. #2141
- Infrastructure improvements:
- The internal test runner now understands compile-only tests and
libcxx/expected_results.txt
. Consequently, (1) compile-only tests (test.compile.pass.cpp
) no longer need a redundantint main() {} // COMPILE-ONLY
, and (2) we no longer need to redundantly updatelibcxx/skipped_tests.txt
(which has been removed) identically tolibcxx/expected_results.txt
. #3484 - Enforced the usage of only core headers when building the STL's import library. #3621
- Updated dependencies. #3490 #3651 #3711
- Updated build compiler to VS 2022 17.7 Preview 1 (17.6 now required).
- Updated Clang to 16.0.1 (now required).
- Updated CMake to 3.26.0 (now required).
- Updated Python to 3.11.3.
- Updated Boost.Math to 1.82.0. #3657
- The internal test runner now understands compile-only tests and
- Updated
_MSVC_STL_UPDATE
. #3518 #3643 #3680
- Merged C++23 features:
-
P1223R5 #3268
ranges::find_last
,ranges::find_last_if
,ranges::find_last_if_not
-
P2167R3 #3258 Improving
boolean-testable
Usage -
P2278R4 #3187 #3234
cbegin
Should Always Return A Constant Iterator - P2404R3 #3345 Move-Only Types For Comparison Concepts
-
P2467R1 #3065
ios_base::noreplace
: Exclusive Mode Forfstream
s -
P2474R2 #3142
views::repeat
-
P2505R5 #3361 Monadic Functions For
expected
-
P2588R3 #3455
barrier
's Phase Completion Guarantees - P2602R2 #3215 Poison Pills Are Too Toxic
-
P2711R1 #3451 Making Multi-Param Constructors Of Views
explicit
-
P1223R5 #3268
- Merged partial C++23 features:
- Merged LWG issue resolutions:
-
LWG-3515 #3236 [stacktrace.basic.nonmem]:
operator<<
should be less templatized -
LWG-3545 #3242
std::pointer_traits
should be SFINAE-friendly -
LWG-3594 #3276
inout_ptr
- inconsistentrelease()
in destructor -
LWG-3629 #3272
make_error_code
andmake_error_condition
are customization points -
LWG-3646 #3261
std::ranges::view_interface::size
returns a signed type -
LWG-3717 #3266
common_view::end
should improverandom_access_range
case -
LWG-3736 #3318
move_iterator
missingdisable_sized_sentinel_for
specialization -
LWG-3737 #3320
take_view::
sentinel
should provideoperator-
-
LWG-3743 #3269
ranges::to
'sreserve
may be ill-formed -
LWG-3746 #3265
optional
's spaceship withU
with a type derived fromoptional
causes infinite constraint meta-recursion -
LWG-3769 #3459
basic_const_iterator::operator==
causes infinite constraint recursion -
LWG-3772 #3462
repeat_view
's piecewise constructor is missing preconditions -
LWG-3778 #3332
vector<bool>
missing exception specifications -
LWG-3785 #3319
ranges::to
is over-constrained on the destination type being a range -
LWG-3798 #3359 Rvalue reference and
iterator_category
-
LWG-3810 #3421 CTAD for
std::basic_format_args
-
LWG-3823 #3231 Unnecessary precondition for
is_aggregate
-
LWG-3848 #3410
slide_view
missingbase
accessor -
LWG-3850 #3423
views::as_const
onempty_view<T>
should returnempty_view<const T>
-
LWG-3853 #3468
basic_const_iterator<volatile int*>::operator->
is ill-formed
-
LWG-3515 #3236 [stacktrace.basic.nonmem]:
- 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 linker errors when using
time_put<wchar_t>
from the Standard Library Modules. #3232 - Fixed another unintentionally dllexported symbol in the import library. #3233
- This would emit a spurious message "Creating library
meow.lib
and objectmeow.exp
" (while buildingmeow.exe
) when using<stacktrace>
or importing the Standard Library Modules.
- This would emit a spurious message "Creating library
- Fixed a binary compatibility break in
basic_string
, which could lead to missing null terminators causing crashes and other runtime misbehavior, when linking code that was built with different versions of the STL. #3235- This ABI break was introduced by #1735 activating the Small String Optimization for
constexpr
basic_string
in VS 2022 17.4. - The affected scenarios involved mixing VS 2022 17.3 (or earlier) with VS 2022 17.4 (or later, until this fix).
- We backported this fix to VS 2022 17.4.5 and VS 2022 17.5.
- This ABI break was introduced by #1735 activating the Small String Optimization for
- Fixed a binary compatibility break in
ppltasks.cpp
poweringstd::async()
, which could lead to crashes caused by aninvalid_operation
exception slamming intonoexcept
. #3255- This ABI break was introduced by #2654, and appeared in VS 2022 17.4 when the VCRedist was "unlocked".
- The affected scenarios involved building with VS 2015 (or possibly early versions of VS 2017), using "Single-Threaded Apartments", and running on an end user's machine with the VS 2022 17.4 VCRedist installed.
- We backported this fix to VS 2022 17.4.5 and VS 2022 17.5.
- Fixed incorrect results from
find()
,count()
,ranges::find()
, andranges::count()
. #3247- This fixed a regression that was introduced by #2434 in VS 2022 17.3.
- The affected scenarios involved mixing certain signed and unsigned types; for example, finding/counting occurrences of the
int
-1
in a range ofunsigned int
elements should consider the element0xFFFF'FFFFu
to be equal (due to C++'s usual arithmetic conversions), but it was incorrectly considered to be non-equal. - We backported this fix to VS 2022 17.4.5 and VS 2022 17.5.
- Fixed the visualizer for
optional<T>
to work whenT
has a custom visualizer. #3243 - Fixed compiler warnings when passing
long double
tocopysign()
. #3253 - Re-enabled ASan (Address Sanitizer) annotations in
<string>
after fixing significant bugs. #3164- Also fixed ASan annotations in
<vector>
that were failing whenpmr::vector
was used withpmr::monotonic_buffer_resource
on x86.
- Also fixed ASan annotations in
- Fixed compiler errors when passing
ranges
types tostd::copy()
. #3270 - Fixed
shared_future<void>
's move assignment operator to benoexcept
as required by the Standard. #3284 - Fixed Clang compiler errors involving intrinsics by including
<intrin.h>
, which is a header that Clang recognizes and supports. #3285 - Fixed
numeric_limits
to correctly report thatis_signed
istrue
for the STL's internal 128-bit signed-integer-class type. #3291 - Fixed
<stacktrace>
to correctly passSYMOPT_FAIL_CRITICAL_ERRORS
to the Windows API. #3292 - Fixed
<charconv>
(and headers that include it, like<chrono>
and<format>
) to avoid emitting warning C4365 "signed/unsigned mismatch" when being compiled with/J
. #3295-
Note: We strongly discourage any use of the
/J
compiler option, as it's a recipe for One Definition Rule violations and it doesn't improve Standard conformance.
-
Note: We strongly discourage any use of the
- Fixed
ranges::cbegin
,ranges::cend
,ranges::crbegin
,ranges::crend
, andranges::cdata
to behave like their non-const
counterparts when given array rvalues. #3316 - Added compiler bug workarounds:
- Fixed
constexpr
basic_string
to correctly start the lifetimes of its elements, avoiding compiler errors. #3334 - Fixed
views::istream
constraints to precisely follow the Standard. #3335 - Implemented C++17's parallel specialized
<memory>
algorithms. #3145 - Fixed
vector<bool, Alloc>
on 32-bit platforms with 64-bitdifference_type
s to support storing more than 232 bits. #3342 - Fixed a compiler error when calling
ranges::prev
on aniota_view
iterator in debug mode. #3356 - Fixed
ranges::minmax
to avoid moving from an element twice when called with a single-element range ofmove_iterator
s. #3366 - Fixed a minor conformance issue in the
std.ixx
Standard Library Module. #3373- When
module;
introduces a global module fragment, it is required to be the first thing in the file other than comments, although MSVC doesn't enforce this rule yet.
- When
- Changed the STL's usage of a compiler-specific custom attribute to defend against macros. #3380
- Fixed Clang
-Wdeprecated
warnings that said "out-of-line definition of constexpr static data member is redundant in C++17 and is deprecated". #3381 - Changed
vformat_to()
to instantiate its machinery in a lazier way. #3403- When merely including
<format>
or<chrono>
, this avoids instantiating dynamic initializers for facet IDs, and improves throughput slightly.
- When merely including
- Fixed linker errors when using
- Improved performance:
- Avoided constructing unnecessary
string
s inlocale::operator==()
. #3250 - Activated
count()
's vectorized implementation for more eligible iterators in C++14/17 modes. #3262 - Activated the vectorized implementations of
find()
,count()
,ranges::find()
, andranges::count()
for more scenarios involving pointer elements. #3267 - Optimized
<atomic>
for ARM64, massively improving load-acquire and store-release (measured 14.1x to 23.8x speedups - times, not percent) and significantly improving sequentially consistent stores (measured 1.58x speedup). #3399 -
ranges::find
now callsmemchr()
in more situations (when the vectorized implementation isn't available). #3386
- Avoided constructing unnecessary
- Improved throughput:
- Enhanced behavior:
- The STL now supports
/clr
for C++11 multithreading (mutex
,condition_variable
,future
, etc.) and C++17 parallel algorithms. Additionally, the STL now allows/clr
to be used in C++20 mode. #3194 #3201- See tracking issue #3193 for a list of compiler bugs that affect these newly enabled
/clr
scenarios.
- See tracking issue #3193 for a list of compiler bugs that affect these newly enabled
- Added visualizers for
error_category
anderror_code
. #3204 - Improved the output of
source_location::function_name()
. #3206- For example, it now returns
"int __cdecl square(int)"
instead of"square"
.
- For example, it now returns
- When iterator debugging detects bogus usage of an invalidated
vector
iterator, it now displays an assertion message instead of abruptly crashing. #3282 - Changed
<mutex>
to use scope guards instead ofthrow;
, making debugging easier when exceptions are thrown. #3321 - Strengthened the exception specifications for:
- Added
modules/modules.json
to support build systems. #3358 #3488 - Refactored
ranges::minmax
andranges::minmax_element
to detect the single-element case naturally. #3384 - Changed the STL's user-defined literals to be consistently defined as
operator""meow
without a space, because CWG-2521 is deprecating the formoperator"" woof
with a space. #3453
- The STL now supports
- Improved documentation:
- Clarified the error message when including the internal header
<__msvc_cxx_stdatomic.hpp>
in C mode. #3192
- Clarified the error message when including the internal header
- Improved test coverage:
- Enabled
<stdatomic.h>
test coverage for Clang. #3186 - Updated the modules tests after a compiler bugfix for
source_location
. #3339 - Added more tests for
views::elements
. #3350 - Updated our LLVM submodule reference, including new tests. #3344 #3357
- Added more tests for
views::drop
,views::drop_while
,views::take
, andviews::take_while
. #3390
- Enabled
- Code cleanups:
- Removed compiler bug workarounds. #3202 #3288 #3351 #3350
- Removed comments that were citing proposed resolutions for LWG issues, now that those issues have been officially resolved by the November 2022 and February 2023 meetings. #3238 #3461
- Improved consistency in preprocessor comments. #3208
- Simplified a line in
experimental::filesystem::recursive_directory_iterator::operator++()
. #3279 - Various cleanups (described in detail in the PRs, not repeated here). #3293 #3300
- Removed unused internal machinery. #3299
- Simplified types by defaulting some of their special member functions:
- Changed more temporary objects to be constructed with braces instead of parentheses. #3277
- Updated comments after a compiler bug was fixed. #3394
- Updated tests and separately compiled sources to directly use the
[[nodiscard]]
attribute. #3397 - Updated notes for skipped tests in the
libcxx
test suite. #3464
- Infrastructure improvements:
- Added GitHub Actions to automatically add PR cards to the Code Reviews project. #3393
- Fixed the build system to properly pass options when assembling the "alias objects". #3402
- Updated dependencies. #3202 #3288 #3340 #3351 #3467
- Updated build compiler to VS 2022 17.5 Preview 6 (now required).
- Updated CMake to 3.25 (now required).
- Updated Python to 3.11.2.
- Updated Boost.Math to 1.81.0. #3312
- Updated
_MSVC_STL_UPDATE
. #3191 #3264 #3362 #3395