You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -22,11 +22,9 @@ For changes in earlier versions of Visual Studio:
22
22
23
23
## <aname="msvc_14_50"></a> C++ conformance improvements, behavior changes, and bug fixes in MSVC Build Tools v14.50
24
24
25
-
Microsoft C/C++ in Visual Studio (MSVC) Build Tools v14.50 introduces significant C++ language updates, conformance improvements, and bug fixes. This version ships with Visual Studio 2026 version 18.0 and includes version 19.50 of the MSVC compiler. You can try out these improvements by [downloading the Insiders release](https://aka.ms/vspreview).
25
+
Microsoft C/C++ in Visual Studio (MSVC) Build Tools v14.50 introduces significant C++ language updates, conformance improvements, and bug fixes. This version shipped first with Visual Studio 2026 version 18.0 and includes version 19.50 of the MSVC compiler.
26
26
27
-
This document details the C++ language conformance improvements and compiler enhancements included in MSVC Build Tools v14.50. For updates in the Standard Library, check out the [STL Changelog](https://github.com/microsoft/STL/wiki/Changelog), which is regularly updated.
28
-
29
-
As C++ standards progress in MSVC, you can follow along using the [cppreference compiler support table](https://en.cppreference.com/w/cpp/compiler_support.html) and help us identify what we should be working on next!
27
+
This document details the C++ language conformance improvements and compiler enhancements included in MSVC Build Tools v14.50. For more information about updates in the Standard Library, see [STL Changelog](https://github.com/microsoft/STL/wiki/Changelog), which is regularly updated.
30
28
31
29
## C++23 Features
32
30
@@ -40,7 +38,8 @@ Prior to P0849R8, you needed to explicitly perform decay operations:
40
38
41
39
```cpp
42
40
// Prior to P0849R8:
43
-
voidpop_front_alike(auto& x) {
41
+
voidpop_front_alike(auto& x)
42
+
{
44
43
using T = std::decay_t<decltype(x.front())>;
45
44
std::erase(x, T(x.front()));
46
45
}
@@ -50,7 +49,8 @@ After P0849R8, you can use the simpler `auto(x)` syntax:
50
49
51
50
```cpp
52
51
// After P0849R8:
53
-
void pop_front_alike(auto& x) {
52
+
void pop_front_alike(auto& x)
53
+
{
54
54
std::erase(x, auto(x.front()));
55
55
}
56
56
```
@@ -69,14 +69,15 @@ This feature provides a standardized way to perform decay-copy operations, makin
69
69
#warning configuration deprecated...
70
70
```
71
71
72
-
The `#warning` directive allows you to emit diagnostic messages without stopping compilation, making it useful for deprecation notices and configuration warnings.
72
+
The `#warning` directive allows you to emit diagnostic messages without stopping compilation, making it useful for deprecation notices and configuration warnings. For more information, see [#warning directive (C/C++)](/cpp/preprocessor/hash-warning-directive-c-cpp).
73
73
74
74
### CWG Issue 2586: Explicit object parameter for assignment and comparison
75
75
76
76
[CWG Issue 2586](https://cplusplus.github.io/CWG/issues/2586) allows explicit object parameters in assignment and comparison operators, enabling more flexible operator definitions.
auto operator<=>(this const S&, const S&) = default; // Valid after CWG2586.
82
83
};
@@ -90,11 +91,13 @@ This change allows you to use the explicit object parameter syntax (deducing `th
90
91
91
92
```cpp
92
93
template <typename T, size_t N>
93
-
constexpr size_t array_size(T (&)[N]) {
94
+
constexprsize_tarray_size(T (&)[N])
95
+
{
94
96
return N;
95
97
}
96
98
97
-
void check(int const (¶m)[3]) {
99
+
void check(int const (¶m)[3])
100
+
{
98
101
constexpr auto s2 = array_size(param); // Previously ill-formed, now accepted as a constant expression after P2280R4.
99
102
}
100
103
```
@@ -105,157 +108,40 @@ This improvement allows more code to be evaluated at compile time, particularly
105
108
106
109
MSVC Build Tools v14.50 includes numerous smaller conformance improvements that enhance C++ standard compliance:
107
110
108
-
### Core Working Group Issues
109
-
110
-
-**CWG2635**: Constrained structured bindings support
111
-
-**CWG2465**: Coroutine parameters passed to promise constructor improvements
112
-
-**CWG2496**: Ref-qualifiers and virtual overriding corrections
113
-
-**CWG2506**: Structured bindings and array cv-qualifiers fixes
114
-
-**CWG2507**: Default arguments for `operator[]` support
115
-
-**CWG2585**: Behavior alignment with standard requirements
116
-
-**CWG2521**: Deprecation of 'operator string-literal identifier'
117
-
-**CWG2528**: Relaxed conversion rules for the spaceship operator
118
-
119
-
### Language Feature Enhancements
120
-
121
-
-**P2360R0**: Extended init-statement definition to allow alias-declarations
122
-
-**P2290R3**: C++23 hexadecimal/octal delimited escape sequence support in string literals
123
-
-**P2797R0**: Resolution for CWG2692 regarding static and explicit object member functions with the same parameter-type-lists
124
-
-**P2266R3**: Simpler implicit move semantics
125
-
126
-
### Compiler Diagnostics
127
-
128
-
- Implementation of a warning to notify of enum type changes caused by `/Zc:enumTypes`
129
-
130
-
## Compiler Improvements in v14.50
131
-
132
-
MSVC Build Tools v14.50 includes extensive compiler improvements across multiple areas, focusing on reliability, correctness, and conformance.
133
-
134
-
### C++/CLI Improvements
135
-
136
-
The C++/CLI compiler received several important fixes:
137
-
138
-
-**ICE fixes**: Resolved internal compiler errors on use of `auto` in member declarations in C++/CLI managed types
139
-
-**Static constexpr support**: Fixed crashes related to [static constexpr in C++/CLI](https://developercommunity.visualstudio.com/t/static-constexpr-causes-CCLI-compiler/1536217)
140
-
-**Friend declarations**: Corrected crashes when [friend functions are used with managed types](https://developercommunity.visualstudio.com/t/Compiler-crash-A-managed-type-cannot-ha/1536159)
141
-
-**Stack ref-types**: Fixed crashes in [C++/CLI code using ref-types on stack](https://developercommunity.visualstudio.com/t/clexe-terminates-with-error-code--52970/10777778)
142
-
-**MFC compatibility**: Resolved [multiple errors in managed C++ code in MFC applications](https://developercommunity.visualstudio.com/t/Visual-Studio-1712-introduced-multiple-/10792822)
143
-
144
-
### Diagnostics Improvements
145
-
146
-
Enhanced diagnostic accuracy and clarity:
147
-
148
-
- Fixed incorrect diagnostic about [implicit enum type conversions in C even with explicit casts](https://developercommunity.visualstudio.com/t/warning-C5287:-operands-are-different-e/10877942)
149
-
150
-
### `constexpr` Enhancements
151
-
152
-
Significant improvements to `constexpr` evaluation and support:
153
-
154
-
#### Virtual Function Support
155
-
- Fixed errors involving [virtual function calls at compile-time](https://developercommunity.visualstudio.com/t/MSVC-erroneously-claims-the-return-value/10184063)
- Corrected [virtual constexpr function evaluation](https://developercommunity.visualstudio.com/t/Virtual-constexpr-function-did-not-evalu/10360010)
158
-
159
-
#### Expression Evaluation
160
-
- Improved rejection of [overflow from addition and left shifting of constants](https://developercommunity.visualstudio.com/content/problem/1202945/signed-overflow-in-constant-core-expression-should.html)
161
-
- Fixed scenarios where [constructors should be made implicitly constexpr](https://developercommunity.visualstudio.com/t/Multiple-constexpr-bugs-including-regre/10855054)
162
-
- Resolved issues with [constexpr static data members and CRTP](https://developercommunity.visualstudio.com/content/problem/1110270/crtp-in-msvc-1924-not-seeing-variable.html)
163
-
164
-
#### Advanced `constexpr` Features
165
-
- Fixed bugs related to [evaluating destructors of constant objects](https://developercommunity.visualstudio.com/t/MSVC-1437-40-forces-my-global-std::stri/10794576)
166
-
- Improved [constexpr lambda captures with guaranteed copy elision](https://developercommunity.visualstudio.com/t/Lambda-in-a-function-template-requests-c/10922885)
167
-
- Allowed [consteval constructor calls as direct-initialization arguments](https://developercommunity.visualstudio.com/t/MSVC-Fails-to-compile-list-and-direct-in/10915063)
168
-
- Fixed issues with [consteval functions in `if consteval` contexts](https://developercommunity.visualstudio.com/t/The-consteval-function-is-not-an-immedia/10900618)
169
-
170
-
### C++ Modules Improvements
171
-
172
-
Enhanced C++20 modules support with numerous bug fixes:
173
-
174
-
#### Import and Export Fixes
175
-
- Fixed bug with [importing friend declarations in nlohmann/json library](https://developercommunity.visualstudio.com/t/nlohmannjson-does-not-compile-as-C20-/10908164)
176
-
- Resolved [compiler crashes with using-declarations from specializations](https://developercommunity.visualstudio.com/t/Internal-compiler-error-when-using-usin/10934729)
177
-
- Fixed issues where [std::expected couldn't be specialized when imported](https://developercommunity.visualstudio.com/t/C1907-modules-constexpr-and-std::expect/10501314)
178
-
179
-
#### Function and Variable Handling
180
-
- Corrected problems with [functions using types from named modules](https://developercommunity.visualstudio.com/t/Compiler-uses-non-exported-class-definit/10863347)
181
-
- Fixed [importing constexpr functions with static local variables](https://developercommunity.visualstudio.com/t/ICE-when-calling-imported-function-that-/10913469)
182
-
- Improved [pragma warning directive handling in modules](https://developercommunity.visualstudio.com/t/pragma-warningdisable-not-working-in-/10937100)
183
-
184
-
#### Real-World Compatibility
185
-
- Fixed various issues preventing [Unreal Engine 5 from building with header units](https://developercommunity.visualstudio.com/t/Unreal-does-not-build-with-header-units-/10800119)
- Fixed problems with [specializations in the global module fragment](https://developercommunity.visualstudio.com/t/C20-modules:-specialzations-in-the-glo/10826499)
111
+
- [CWG2635](https://cplusplus.github.io/CWG/issues/2635): Constrained structured bindings support
112
+
- [CWG2465](https://cplusplus.github.io/CWG/issues/2465): Coroutine parameters passed to promise constructor improvements
113
+
- [CWG2496](https://cplusplus.github.io/CWG/issues/2496): Ref-qualifiers and virtual overriding corrections
114
+
- [CWG2506](https://cplusplus.github.io/CWG/issues/2506): Structured bindings and array cv-qualifiers fixes
115
+
- [CWG2507](https://cplusplus.github.io/CWG/issues/2507): Default arguments for `operator[]` support
116
+
- [CWG2585](https://cplusplus.github.io/CWG/issues/2585): Behavior alignment with standard requirements
117
+
- [CWG2521](https://cplusplus.github.io/CWG/issues/2521): Deprecation of 'operator string-literal identifier'
118
+
- [CWG2528](https://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#2528): Relaxed conversion rules for the spaceship operator
119
+
- [P2360R0](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2360r0.html): Extended init-statement definition to allow alias-declarations
120
+
- [P2290R3](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2290r3.pdf): C++23 hexadecimal/octal delimited escape sequence support in string literals
121
+
- [P2797R0](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2797r0.html): Resolution for CWG2692 regarding static and explicit object member functions with the same parameter-type-lists
For more information about compiler improvements and bug fixes in MSVC Build Tools v14.50, see [C++ Language Updates in MSVC Build Tools v14.50](https://devblogs.microsoft.com/cppblog/c-language-updates-in-msvc-build-tools-v14-50/)
188
125
189
126
### Conformance Enhancements
190
127
191
128
Improved adherence to C++ standards:
192
129
193
130
#### Attribute Support
194
-
- Added support for [`[[maybe_unused]]` on labels](https://developercommunity.visualstudio.com/t/unreferenced-label-when-ref-hidden-by-if/102076)
195
-
- Fixed warning C4102 (unreferenced label) when the only reference was from a discarded `if constexpr` branch
131
+
- Added support for [`[[maybe_unused]]` on labels](https://developercommunity.visualstudio.com/t/unreferenced-label-when-ref-hidden-by-if/102076).
132
+
- Fixed warning C4102 (unreferenced label) when the only reference was from a discarded `if constexpr` branch.
196
133
197
134
#### Template and Specialization Fixes
198
-
-[Diagnosed ill-formed friend explicit specializations](https://developercommunity.visualstudio.com/t/Defining-explicit-function-template-spec/10933841) that were incorrectly accepted in C++20 or later
- [Diagnosed ill-formed friend explicit specializations](https://developercommunity.visualstudio.com/t/Defining-explicit-function-template-spec/10933841) that were incorrectly accepted in C++20 or later.
- Fixed issues with [missing 'template' keyword diagnostics](https://developercommunity.visualstudio.com/t/No-diagnostic-for-missing-template-in-d/10501221)
201
138
202
-
### Reliability Improvements
203
-
204
-
Extensive internal compiler error (ICE) fixes and stability improvements:
205
-
206
-
#### Template-Related Fixes
207
-
- Fixed [ICE on explicit class template instantiation with friend functions](https://developercommunity.visualstudio.com/t/Internal-compiler-error-ICE-on-explici/10903887)
208
-
- Resolved [ICE with explicit variable template instantiations and PCH files](https://developercommunity.visualstudio.com/t/C-explicit-variable-template-instantia/10933044)
209
-
- Corrected [compiler crashes with deep nesting of aggregates and initializer lists](https://developercommunity.visualstudio.com/t/Internal-Compiler-Error-Found-in-MSVC-14/10914206)
210
-
211
-
#### Lambda-Related Improvements
212
-
- Fixed issues with [nested generic lambdas](https://developercommunity.visualstudio.com/t/VS-1714-Preview-30:-ICE:-error-C1001:-/10891418)
213
-
- Resolved [ICE with lambda captures and template parameters](https://developercommunity.visualstudio.com/t/ICE-with-nested-std::visit--lambda-capt/10910959)
- Fixed [exponential memory growth during type deduction](https://developercommunity.visualstudio.com/t/VS-2022-C-compiler-uses-nearly-200x-as/10900008) with classes having many base classes
218
-
- Improved [IL generation for temporaries bound to non-static data member references](https://developercommunity.visualstudio.com/t/CLexe-crashes-with-Access-Violation-on-/10878252)
219
-
220
-
### Correctness Improvements
221
-
222
-
Enhanced code generation and semantic analysis:
223
-
224
-
#### Exception Handling and References
225
-
- Fixed [exception handling issues with unions](https://developercommunity.visualstudio.com/t/CLexe-exited-with-code--529706956-whe/10915135)
226
-
- Improved [rvalue reference handling in lambda contexts](https://developercommunity.visualstudio.com/t/When-using-a-lambda-as-a-template-argume/10916555)
227
-
- Corrected [explicit instantiation overload resolution with requires clauses](https://developercommunity.visualstudio.com/t/Overload-resolution-for-constrained-func/10107770)
- Improved [phase-1 name binding in non-static data member initializers](https://developercommunity.visualstudio.com/t/Wrong-context-for-class-field-initialize/10896684)
232
-
- Corrected [value category determination for indirection and array expressions](https://developercommunity.visualstudio.com/t/cl-Preview-fails-to-properly-determine-a/10907452)
233
-
234
-
#### Template and SFINAE
235
-
- Fixed [template-id parsing in alias declarations](https://developercommunity.visualstudio.com/t/Source-code-parsing-error-in-boostparse/10869546)
236
-
- Improved [partial ordering with template parameter objects](https://developercommunity.visualstudio.com/t/Template-Specialization-is-not-selected-/10902294)
- Fixed [`__declspec(no_sanitize_address)` handling on lambdas](https://developercommunity.visualstudio.com/t/Address-Sanitizer-declspecsattributes-d/10850249)
241
-
- Improved [static inline data member instantiation points](https://developercommunity.visualstudio.com/t/static-inline-atomic-and-another-atomic-/10203656)
242
-
- Corrected [static operator() in abbreviated function templates](https://developercommunity.visualstudio.com/t/Call-to-static-operator-is-elided/10908158)
- Improved [concept and constraint evaluation](https://developercommunity.visualstudio.com/t/VS-1714-if-constexpr-requires--does/10905731)
253
144
254
-
### C Compiler Improvements
255
-
256
-
#### C23 Language Features
257
-
- Fixed `typeof` behavior with function types: In C23, functions no longer [decay to function pointers when used as arguments to `typeof`](https://developercommunity.visualstudio.com/t/__typeof__-not-working-with-function-typ/10891974)
258
-
259
145
## Migrating to MSVC Build Tools v14.50
260
146
261
147
When upgrading to MSVC Build Tools v14.50, consider the following potential breaking changes and migration guidance:
@@ -287,7 +173,7 @@ When upgrading to MSVC Build Tools v14.50, consider the following potential brea
287
173
288
174
## Conclusion
289
175
290
-
MSVC Build Tools v14.50 represents a significant advancement in C++ compiler technology, bringing substantial improvements in C++23 conformance, reliability, and correctness. The extensive bug fixes and enhancements make this release particularly valuable for large-scale C++ development projects.
176
+
MSVC Build Tools v14.50 represents a significant advancement to the MSVC compiler, bringing substantial improvements in C++23 conformance, reliability, and correctness. The extensive bug fixes and enhancements make this release particularly valuable for large-scale C++ development projects.
291
177
292
178
Key highlights include:
293
179
- Advanced C++23 feature support including `auto(x)` decay-copy and `#warning` directive
0 commit comments