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
Copy file name to clipboardExpand all lines: docs/overview/msvc-conformance-improvements.md
+32-33Lines changed: 32 additions & 33 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,9 +7,7 @@ ms.subservice: "cpp-lang"
7
7
---
8
8
# C++ Conformance improvements, behavior changes, and bug fixes in Microsoft C/C++ (MSVC)
9
9
10
-
Microsoft C/C++ makes conformance improvements and bug fixes in every release. This article lists the significant improvements by MSVC Build Tools version. To jump directly to the changes for a specific version, use the **In this article** links at the top of this article.
11
-
12
-
This document lists changes starting in November 2025 when Visual Studio and the MSVC toolset versioning diverged.
10
+
Microsoft C/C++ makes conformance improvements and bug fixes in every release. Starting with Visual Studio 2026 18.0, major improvements are organized by MSVC Build Tools version number. To jump directly to the changes for a specific version, use the **In this article** links at the top of this article.
13
11
14
12
For changes in earlier versions of Visual Studio:
15
13
@@ -22,18 +20,18 @@ For changes in earlier versions of Visual Studio:
22
20
23
21
## <aname="msvc_14_50"></a> C++ conformance improvements, behavior changes, and bug fixes in MSVC Build Tools v14.50
24
22
25
-
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.
23
+
MSVC Build Tools v14.50 introduces improvements to the MSVC compiler and Standard Library, including better C++23 standards conformance, enhanced reliability, and improved correctness. This release also includes numerous bug fixes and updates that benefit large-scale C++ development.
26
24
27
25
This version shipped first with Visual Studio 2026 version 18.0 and includes version 19.50 of the MSVC compiler.
28
26
29
-
Key highlights include:
30
-
- Advanced C++23 feature support including `auto(x)` decay-copy and `#warning` directive
31
-
- Comprehensive `constexpr` improvements, particularly for virtual functions
- Enhanced C++/CLI support for managed code scenarios
35
-
- The Microsoft C++ standard library (STL) no longer supports targeting Windows 7/Server 2008 R2, Windows 8/Server 2012, or Windows 8.1/Server 2012 R2.\
36
-
- Windows 10/Server 2016 are the minimum supported operating systems.\
27
+
Key highlights of this release include:
28
+
- Advanced C++23 feature support including `auto(x)` decay-copy and `#warning` directive.
29
+
- Comprehensive `constexpr` improvements, particularly for virtual functions.
- Enhanced C++/CLI support for managed code scenarios.
33
+
- The Microsoft C++ standard library (MSVC STL) no longer supports targeting Windows 7/Server 2008 R2, Windows 8/Server 2012, or Windows 8.1/Server 2012 R2.
34
+
- Windows 10/Server 2016 are the minimum supported operating systems.
37
35
38
36
For more information about performance improvements, bug fixes, and conformance updates in the Standard Library, see [STL Changelog](https://github.com/microsoft/STL/wiki/Changelog), which is updated regularly.
39
37
@@ -45,10 +43,10 @@ MSVC Build Tools v14.50 adds support for several C++23 features, bringing the co
45
43
46
44
[P0849R8](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0849r8.html) introduces the `auto(x)` syntax for decay-copy operations directly in the language, providing a more concise way to express decay-copy semantics.
47
45
48
-
Prior to P0849R8, you needed to explicitly perform decay operations:
46
+
Before P0849R8, you needed to explicitly perform decay operations:
49
47
50
48
```cpp
51
-
//Prior to P0849R8:
49
+
//Before P0849R8:
52
50
voidpop_front_alike(auto& x)
53
51
{
54
52
using T = std::decay_t<decltype(x.front())>;
@@ -73,7 +71,7 @@ This feature provides a standardized way to perform decay-copy operations, makin
73
71
[P2437R1](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2437r1.pdf) implements the C++23 `#warning` preprocessor directive, providing a standard way to emit warnings during compilation.
74
72
75
73
```cpp
76
-
// Valid prior to C++23.
74
+
// Valid before C++23.
77
75
#error bad configuration...
78
76
79
77
// Valid after C++23.
@@ -118,7 +116,7 @@ void g()
118
116
}
119
117
```
120
118
121
-
In C++20, and earlier, this code would have compiled because even though the type of `t` is `S&&` the use of `t` in `return t` is treated as a glvalue and so it can bind to the return type.\
119
+
In C++20, and earlier, this code compiled because even though the type of `t` is `S&&` the use of `t` in `return t` is treated as a glvalue and so it can bind to the return type.\
122
120
With C++23, `t` is treated as an xvalue and so it can't bind to an lvalue reference.\
123
121
One fix is to change to the return type of the function from `T&` to `T&&` but this may affect code that calls this function. An alternative is to use the feature test macro that is associated with this change. For example:
This improvement allows more code to be evaluated at compile time, particularly when dealing with function parameters in template contexts.
159
157
160
-
## Conformance Enhancements
158
+
## Conformance enhancements
161
159
162
-
Improved adherence to C++ standards:
160
+
Improved adherence to C++ standards includes better handling of attributes, templates, and C++20/C++23 features.
163
161
164
-
### Attribute Support
162
+
### Attribute support
165
163
166
164
- Added support for [`[[maybe_unused]]` on labels](https://developercommunity.visualstudio.com/t/unreferenced-label-when-ref-hidden-by-if/102076).
167
165
- Fixed warning C4102 (unreferenced label) when the only reference was from a discarded `if constexpr` branch.
168
166
169
-
### Template and Specialization Fixes
167
+
### Template and specialization fixes
170
168
171
169
- [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.
- Improved [concept and constraint evaluation](https://developercommunity.visualstudio.com/t/VS-1714-if-constexpr-requires--does/10905731)-
176
+
- Improved [concept and constraint evaluation](https://developercommunity.visualstudio.com/t/VS-1714-if-constexpr-requires--does/10905731)
179
177
180
-
### Smaller Conformance Updates
178
+
### Smaller conformance updates
181
179
182
180
MSVC Build Tools v14.50 includes numerous smaller conformance improvements that enhance C++ standard compliance:
183
181
@@ -196,15 +194,15 @@ MSVC Build Tools v14.50 includes numerous smaller conformance improvements that
196
194
197
195
## Bug fixes
198
196
199
-
Bug fixes for C++ Modules, `constexpr`, and other fixes were made in v14.50.
197
+
Bug fixes for C++ Modules, `constexpr`, and other fixes were made in MSVC v14.50.
200
198
201
-
For a detailed list of bug fixes, see [Compiler Improvements in v14.50](https://devblogs.microsoft.com/cppblog/c-language-updates-in-msvc-build-tools-v14-50/#compiler-improvements-in-v14.50)
199
+
For a detailed list of bug fixes, see [Compiler Improvements in v14.50](https://devblogs.microsoft.com/cppblog/c-language-updates-in-msvc-build-tools-v14-50/#compiler-improvements-in-v14.50).
202
200
203
-
**Encoding of certain non-type template arguments corrected**
201
+
**Encoding of certain nontype template arguments corrected**
204
202
205
203
Affects `/stdc++20` or later.
206
204
207
-
Certain non-type pointer type template arguments involving sub-objects could lead to linking issues or in some cases silent bad code generation where what should be distinct specializations collide.
205
+
Certain nontype pointer type template arguments involving subobjects could lead to linking issues or in some cases silent bad code generation where what should be distinct specializations collide.
208
206
209
207
```cpp
210
208
struct A
@@ -236,33 +234,34 @@ With this fix, the two calls to `f` get distinct encodings, as required.
236
234
237
235
When upgrading to MSVC Build Tools v14.50, consider the following potential breaking changes and migration guidance:
238
236
239
-
### C++23 Feature Adoption
237
+
### C++23 feature adoption
240
238
- Update code to take advantage of new `auto(x)` decay-copy syntax for cleaner template code
241
239
- Consider using `#warning` directives for deprecation notices instead of error-prone conditional compilation
242
240
- Review explicit object parameter usage in operators for improved consistency
243
241
244
-
### `constexpr`Improvements
242
+
### `constexpr`improvements
245
243
- Existing `constexpr` code may now compile that previously failed, particularly with virtual functions
246
244
- Review constant evaluation code for potential new optimization opportunities
247
245
- Update CRTP patterns that may now work correctly with static constexpr members
248
246
249
-
### Modules Migration
247
+
### Modules migration
250
248
- Projects using C++20 modules should see improved stability and compatibility
251
249
- Header units now work more reliably with large codebases like Unreal Engine 5
252
250
- Consider migrating from traditional headers to modules for better compilation performance
253
251
254
-
### Compiler Diagnostics
252
+
### Compiler diagnostics
255
253
- New warnings may appear for previously undiagnosed issues
256
254
- Review enum type usage if using `/Zc:enumTypes`
257
255
- Update code that relies on implicit conversions that may now be flagged
258
256
259
-
### C Code Updates
257
+
### C code updates
260
258
- C23 features are available with `/std:clatest`
261
259
-`typeof` behavior changes may affect existing code
262
260
- Review preprocessor usage for new `__VA_OPT__` availability
263
261
262
+
## Provide feedback
264
263
265
-
For the latest updates and to provide feedback, please visit the [Visual Studio Developer Community](https://developercommunity.visualstudio.com/) or contact the team at [[email protected]](mailto:[email protected]). Follow us on Twitter [@visualc](https://twitter.com/visualc) or BlueSky [@msftcpp.bsky.social](https://bsky.app/profile/msftcpp.bsky.social).
264
+
For the latest updates and to provide feedback, visit the [Visual Studio Developer Community](https://developercommunity.visualstudio.com/) or contact the team at [[email protected]](mailto:[email protected]). Follow us on Twitter [@visualc](https://twitter.com/visualc) or BlueSky [@msftcpp.bsky.social](https://bsky.app/profile/msftcpp.bsky.social).
266
265
267
266
If you encounter problems with MSVC in Visual Studio 2026, please let us know via the [Report a Problem](how-to-report-a-problem-with-the-visual-cpp-toolset.md) option, either from the installer or the Visual Studio IDE itself.
0 commit comments