Skip to content

Commit a3add31

Browse files
committed
Merge branch 'master' into constexpr_machinery
2 parents 0d8082a + 6c9f6da commit a3add31

File tree

23 files changed

+1026
-65
lines changed

23 files changed

+1026
-65
lines changed

.vscode/settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"editor.formatOnSave": true,
66
"files.associations": {
77
".clang-format": "yaml",
8+
"header-units.json": "jsonc",
89
"**/stl/inc/**": "cpp"
910
},
1011
"files.eol": "\r\n",

stl/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ set(HEADERS
146146
${CMAKE_CURRENT_LIST_DIR}/inc/future
147147
${CMAKE_CURRENT_LIST_DIR}/inc/hash_map
148148
${CMAKE_CURRENT_LIST_DIR}/inc/hash_set
149+
${CMAKE_CURRENT_LIST_DIR}/inc/header-units.json
149150
${CMAKE_CURRENT_LIST_DIR}/inc/initializer_list
150151
${CMAKE_CURRENT_LIST_DIR}/inc/iomanip
151152
${CMAKE_CURRENT_LIST_DIR}/inc/ios

stl/inc/algorithm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4174,6 +4174,7 @@ namespace ranges {
41744174

41754175
for (;; ++_Current) {
41764176
if (++_First == _Last) {
4177+
++_Current;
41774178
return {_STD move(_Current), _STD move(_First)};
41784179
}
41794180

stl/inc/header-units.json

Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
// Copyright (c) Microsoft Corporation.
2+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
3+
4+
{
5+
"Version": "1.0",
6+
"BuildAsHeaderUnits": [
7+
// "__msvc_all_public_headers.hpp", // for testing, not production
8+
"__msvc_system_error_abi.hpp",
9+
"algorithm",
10+
"any",
11+
"array",
12+
"atomic",
13+
"barrier",
14+
"bit",
15+
"bitset",
16+
// "cassert", // design is permanently incompatible with header units
17+
// "ccomplex", // removed in C++20
18+
"cctype",
19+
"cerrno",
20+
"cfenv",
21+
"cfloat",
22+
"charconv",
23+
"chrono",
24+
"cinttypes",
25+
// "ciso646", // removed in C++20
26+
"climits",
27+
"clocale",
28+
"cmath",
29+
"codecvt",
30+
"compare",
31+
"complex",
32+
"concepts",
33+
"condition_variable",
34+
"coroutine",
35+
"csetjmp",
36+
"csignal",
37+
// "cstdalign", // removed in C++20
38+
"cstdarg",
39+
// "cstdbool", // removed in C++20
40+
"cstddef",
41+
"cstdint",
42+
"cstdio",
43+
"cstdlib",
44+
"cstring",
45+
// "ctgmath", // removed in C++20
46+
"ctime",
47+
"cuchar",
48+
"cwchar",
49+
"cwctype",
50+
"deque",
51+
"exception",
52+
"execution",
53+
"filesystem",
54+
"forward_list",
55+
"fstream",
56+
"functional",
57+
"future",
58+
// "hash_map", // non-Standard, will be removed soon
59+
// "hash_set", // non-Standard, will be removed soon
60+
"initializer_list",
61+
"iomanip",
62+
"ios",
63+
"iosfwd",
64+
"iostream",
65+
"iso646.h",
66+
"istream",
67+
"iterator",
68+
"latch",
69+
"limits",
70+
"list",
71+
"locale",
72+
"map",
73+
"memory",
74+
"memory_resource",
75+
"mutex",
76+
"new",
77+
"numbers",
78+
"numeric",
79+
"optional",
80+
"ostream",
81+
"queue",
82+
"random",
83+
"ranges",
84+
"ratio",
85+
"regex",
86+
"scoped_allocator",
87+
"semaphore",
88+
"set",
89+
"shared_mutex",
90+
"span",
91+
"sstream",
92+
"stack",
93+
"stdexcept",
94+
"stop_token",
95+
"streambuf",
96+
"string",
97+
"string_view",
98+
"strstream",
99+
"system_error",
100+
"thread",
101+
"tuple",
102+
"type_traits",
103+
"typeindex",
104+
"typeinfo",
105+
"unordered_map",
106+
"unordered_set",
107+
"use_ansi.h",
108+
"utility",
109+
"valarray",
110+
"variant",
111+
"vector",
112+
"version",
113+
"xatomic.h",
114+
"xatomic_wait.h",
115+
"xbit_ops.h",
116+
"xcall_once.h",
117+
"xcharconv.h",
118+
"xcharconv_ryu.h",
119+
"xcharconv_ryu_tables.h",
120+
"xerrc.h",
121+
"xfacet",
122+
"xfilesystem_abi.h",
123+
"xhash",
124+
"xiosbase",
125+
// "xkeycheck.h", // internal header, provides no machinery, scans for macroized keywords only
126+
"xlocale",
127+
"xlocbuf",
128+
"xlocinfo",
129+
"xlocinfo.h",
130+
"xlocmes",
131+
"xlocmon",
132+
"xlocnum",
133+
"xloctime",
134+
"xmemory",
135+
"xnode_handle.h",
136+
"xpolymorphic_allocator.h",
137+
"xsmf_control.h",
138+
"xstddef",
139+
"xstring",
140+
"xthreads.h",
141+
"xtimec.h",
142+
"xtr1common",
143+
"xtree",
144+
"xutility",
145+
"ymath.h",
146+
"yvals.h",
147+
"yvals_core.h"
148+
]
149+
}

stl/inc/limits

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1058,9 +1058,14 @@ _NODISCARD int _Checked_x86_x64_countr_zero(const _Ty _Val) noexcept {
10581058
constexpr _Ty _Max = (numeric_limits<_Ty>::max)();
10591059

10601060
#ifndef __AVX2__
1061-
const bool _Definitely_have_tzcnt = __isa_available >= __ISA_AVAILABLE_AVX2;
1062-
if (!_Definitely_have_tzcnt && _Val == 0) {
1063-
return _Digits;
1061+
// Because the widening done below will always give a non-0 value, checking for tzcnt
1062+
// is not required for 8-bit and 16-bit since the only difference in behavior between
1063+
// bsf and tzcnt is when the value is 0.
1064+
if constexpr (_Digits > 16) {
1065+
const bool _Definitely_have_tzcnt = __isa_available >= __ISA_AVAILABLE_AVX2;
1066+
if (!_Definitely_have_tzcnt && _Val == 0) {
1067+
return _Digits;
1068+
}
10641069
}
10651070
#endif // __AVX2__
10661071

stl/inc/regex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -936,7 +936,7 @@ basic_ostream<_Elem, _Traits>& operator<<(basic_ostream<_Elem, _Traits>& _Ostr,
936936
}
937937

938938
// FORWARD DECLARATIONS
939-
template <class _BidIt, class _Allocator = allocator<sub_match<_BidIt>>>
939+
template <class _BidIt, class _Alloc = allocator<sub_match<_BidIt>>>
940940
class match_results;
941941

942942
template <class _BidIt, class _Alloc, class _InIt, class _OutIt>

0 commit comments

Comments
 (0)