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
@@ -15,7 +15,8 @@ Enable supported C and C++ language features from the specified version of the C
15
15
> **`/std:c++20`**\
16
16
> **`/std:c++latest`**\
17
17
> **`/std:c11`**\
18
-
> **`/std:c17`**
18
+
> **`/std:c17`**\
19
+
> **`/std:clatest`**
19
20
20
21
## Remarks
21
22
@@ -107,6 +108,9 @@ The compiler doesn't support most optional features of ISO C11. Several of these
107
108
108
109
- Variable length array (VLA) support isn't planned. VLAs provide attack vectors comparable to [`gets`](../../c-runtime-library/gets-getws.md), which is deprecated and planned for removal.
109
110
111
+
**`/std:clatest`**\
112
+
The **`/std:clatest`** option behaves like the `/std:c++latest` switch for the C++ compiler. The switch enables all currently implemented compiler and standard library features proposed for the next draft C standard, as well as some in-progress and experimental features.
113
+
110
114
For more information, see the C Standard library features section of [Microsoft C/C++ language conformance](../../overview/visual-cpp-language-conformance.md).
111
115
112
116
### To set this compiler option in the Visual Studio development environment
Copy file name to clipboardExpand all lines: docs/overview/cpp-conformance-improvements.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,6 +32,10 @@ For a broader summary of changes made to the C++ Standard Library, see [STL Chan
32
32
33
33
Visual Studio 2022 version 17.7 contains the following highlighted conformance improvements, bug fixes, and behavior changes in the Microsoft C/C++ compiler.
34
34
35
+
### Added `/std:clatest` to the C compiler
36
+
37
+
This switch behaves like the `/std:c++latest` switch for the C++ compiler. The switch enables all currently implemented compiler and standard library features proposed for the next draft C standard, as well as some in-progress and experimental features.
38
+
35
39
### C++ Standard Library
36
40
37
41
The `<print>` library is now supported. See [P2093R14 Formatted output](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2093r14.html).
Copy file name to clipboardExpand all lines: docs/overview/what-s-new-for-visual-cpp-in-visual-studio.md
+35-22Lines changed: 35 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,17 +1,33 @@
1
1
---
2
2
title: "What's new for C++ in Visual Studio"
3
3
description: "The new features and fixes in the Microsoft C/C++ compiler and tools in Visual Studio."
4
-
ms.date: 08/23/2023
4
+
ms.date: 11/09/2023
5
5
ms.technology: "cpp-ide"
6
6
ms.custom: intro-whats-new
7
7
---
8
8
9
9
# What's new for C++ in Visual Studio 2022
10
10
11
-
Visual Studio 2022 brings many updates and fixes to the Microsoft C++ environment. We've added features and fixed many bugs and issues in the compiler and tools. The Visual Studio IDE also offers significant improvements in performance and productivity, and now runs natively as a 64-bit application.
11
+
Visual Studio 2022 brings many updates and fixes to the Microsoft C++ environment. We added features and fixed many bugs and issues in the compiler and tools. The Visual Studio IDE also offers significant improvements in performance and productivity, and now runs natively as a 64-bit application.
12
12
13
13
For more information on what's new in all of Visual Studio, see [What's new in Visual Studio 2022](/visualstudio/ide/whats-new-visual-studio-2022?view=vs-2022&preserve-view=true). For information about what's new in the C++ docs, see [Microsoft C++ docs: What's new](./whats-new-cpp-docs.md)
14
14
15
+
## What's new for C++ in Visual Studio version 17.8
16
+
17
+
Briefly, some of the new features are:
18
+
* C++ structured diagnostics in the Output window and a new problem details window that provides more information about the error. For more information, see [Structured SARIF Output](../build/reference/sarif-output.md) and [Problem Details Window](/visualstudio/ide/reference/problem-details-window).
19
+
* A feature that lets you visualize the size and alignment of your classes, structs, unions, base types, or enums even before the code is compiled. Hover over the identifier and a Quick Info displays the size and alignment information.
20
+
* A feature that suggests when to mark member functions `const` because they don’t modify the object’s state. Hover over a member function and click the light bulb icon to mark the function as `const`.
21
+
* Visual Studio now prompts you to mark global functions as static via a screwdriver icon that will appear by the function name. Click the screwdriver icon to mark the function as static.
22
+
* Unused #include directives are dimmed in the editor. You can hover over a dimmed include and use the light bulb menu to either remove that include or all unused includes. You can also add `#include` directives for entities that are currently indirectly included via other headers. For more information, see [Clean up C/C++ includes in Visual Studio](../ide/include-cleanup-overview.md).
23
+
* More Unreal Engine support:
24
+
* Unreal Engine Test Adapter lets you discover, run, manage, and debug your Unreal Engine tests without leaving the Visual Studio IDE.
25
+
* With Unreal Engine Code Snippets, you can find common Unreal Engine constructs as snippets in your member list.
26
+
* Build Insights is now integrated with Visual Studio 2022 and works with MSBuild and CMake projects using MSVC. You can now see additional information about the compilation of a function such as how long it took to compile and the number of ForceInlines.
27
+
* Remote Linux unit test support now lets you run your CTest and GTest tests on your remote Linux machines from Visual Studio’s Test Explorer, just like your local tests.
28
+
29
+
For a summary of new features in the Visual Studio 17.8 IDE, see [Visual Studio 2022 version 17.8 Release Notes](/visualstudio/releases/2022/release-notes).
30
+
15
31
## What's new for C++ in Visual Studio version 17.7
16
32
17
33
For a summary of new C++ features in Visual Studio 17.7, see [What’s New for C++ Developers in Visual Studio 2022 17.7](https://devblogs.microsoft.com/cppblog/whats-new-for-c-developers-in-visual-studio-2022-17-7/).
@@ -22,6 +38,7 @@ Briefly, some of the new features are:
22
38
* One-click download for Windows Subsystem for Linux (WSL)
23
39
* Improved support for Doxygen comments
24
40
* C++ Build Insights for game development
41
+
* Added [`/std:clatest`](../build/reference/std-specify-language-standard-version.md) for the C compiler.
25
42
* Unreal Engine project improvements such as faster IntelliSense and syntax colorization, the ability to find all Unreal Engine Blueprint references, and more.
26
43
27
44
For a summary of new C++ features that are specific to game development, see [Unleashing the Power of Visual Studio 2022 for C++ Game Development](https://devblogs.microsoft.com/visualstudio/unleashing-the-power-of-visual-studio-2022-for-c-game-development/#:~:text=Unleashing%20the%20Power%20of%20Visual%20Studio%202022%20for,6%20Optimizing%20Build%20Times%20in%20Visual%20Studio%20)
@@ -97,7 +114,7 @@ For a summary of new features and bug fixes in Visual Studio in version 17.4, se
97
114
98
115
- Improved compiler error messages to provide more correct and useful information, especially for concepts.
99
116
100
-
- Added experimental MSVC option **`/experimental:log<directory>`** to output SARIF build logs to the specified directory.
117
+
- Added experimental MSVC option [`/experimental:log<directory>`](../build/reference/experimental-log.md) to output [structured SARIF diagnostics](../build/reference/sarif-output.md) to the specified directory.
101
118
102
119
- Added support for C23 attributes to IntelliSense and continued progress in C++20 modules support.
103
120
@@ -121,7 +138,7 @@ For a summary of new features and bug fixes in Visual Studio in version 17.4, se
121
138
- Updated the version of CMake shipped with Visual Studio to version 3.24.1. For details of what is available, see the [CMake release notes](https://cmake.org/cmake/help/v3.24/release/3.24.html).
122
139
123
140
- Android SDK update:
124
-
- Ant scripts have been removed, so users no longer see Ant-based templates in the New Project dialog. For help migrating from Ant templates to Gradle templates, see [Migrating Builds From Apache Ant](https://docs.gradle.org/current/userguide/migrating_from_ant.html)
141
+
- Ant scripts were removed, so users no longer see Ant-based templates in the New Project dialog. For help migrating from Ant templates to Gradle templates, see [Migrating Builds From Apache Ant](https://docs.gradle.org/current/userguide/migrating_from_ant.html)
125
142
- Added support for building with NDK 23 and 24
126
143
- Updated NDK component to the LTS version 23
127
144
@@ -158,7 +175,7 @@ For a summary of new features and bug fixes in Visual Studio in version 17.3, se
158
175
- Visual Studio can now add Unreal Engine class templates for your UE projects. To try this feature, ensure **IDE support for Unreal Engine** is selected in the **Game development with C++** workload in the Visual Studio Installer. When you're working on a UE project, right-click in the project or a folder/filter and select **Add** > **UE Class**.
159
176
160
177
-**Go to Definition** now remembers the prior signature and navigates accordingly when a better match isn't available (for example, after you manually change the signature of one of the pair).
161
-
We've improved responsiveness of **Go To All**. Previously, results appeared after you stopped typing. In the new experience, results show as you type.
178
+
The responsiveness of **Go To All** is improved. Previously, results appeared after you stopped typing. In the new experience, results show as you type.
162
179
163
180
- In contexts requiring `enum` type completion (for example, assignments to `enum` variables, case labels, returning `enum` type, and so on), the autocompletion list is now filtered to just the matching enumerators and related constructs.
164
181
@@ -174,7 +191,7 @@ We've improved responsiveness of **Go To All**. Previously, results appeared aft
174
191
175
192
- Updated the side-by-side Dev 16.11 C++ Toolset to version 14.29.30145.00. The latest version of the Dev 16.11 C++ Toolset contains important bug fixes, including fixing all remaining C++20 defect reports. For more information about bug fixes, including C++20 defect reports in Dev 16.11, see [Visual Studio 2019 version 16.11.14 release notes](/visualstudio/releases/2019/release-notes#16.11.14).
176
193
177
-
-We have made various improvements to the in-editor experience of C++ modules. We're continuously working on improving the quality of the experience but encourage you to try them in 17.3. Report remaining issues through [Developer Community](https://aka.ms/vsfeedback/browsecpp).
194
+
-Made various improvements to the in-editor experience of C++ modules. We're continuously working on improving the quality of the experience but encourage you to try them in 17.3. Report remaining issues through [Developer Community](https://aka.ms/vsfeedback/browsecpp).
178
195
179
196
## What's new for C++ in Visual Studio version 17.2
180
197
@@ -190,12 +207,12 @@ For a summary of new features and bug fixes in Visual Studio in version 17.2, se
190
207
191
208
- In 17.1, we introduced peripheral register and RTOS views for embedded developers. We continue to improve the capabilities of those views with usability improvements in 17.2:
192
209
- The RTOS tool window is now hidden by default. It prevents showing a tool window with error messages that aren't relevant when you're not using an RTOS.
193
-
- When you choose (double-click) an RTOS object in the tool window, it adds a watch for the object.
194
-
- When you select the start and end values for the stack pointer in the RTOS tool window, it's opened in the memory window.
195
-
-We've added thread awareness for device targets to the call stack window.
210
+
- When you double-click an RTOS object in the tool window, it adds a watch for the object.
211
+
- When you select the start and end values for the stack pointer in the RTOS tool window, it opens in the memory window.
212
+
-Added thread awareness for device targets to the call stack window.
196
213
- Users can now select a pin icon next to peripherals, registers, or fields to pin them the top of the Peripheral View.
197
214
198
-
-We've added implementations of the remaining C++20 defect reports (also known as *backports*). All C++20 features are now available under the **`/std:c++20`** option. For more information about the implemented backports, see the [C++20 Defect Reports project](https://github.com/microsoft/STL/projects/9) in the Microsoft/STL GitHub repository and the [MSVC's STL Completes `/std:c++20`](https://devblogs.microsoft.com/cppblog/msvcs-stl-completes-stdc20/) blog post.
215
+
-Added implementations of the remaining C++20 defect reports (also known as *backports*). All C++20 features are now available under the **`/std:c++20`** option. For more information about the implemented backports, see the [C++20 Defect Reports project](https://github.com/microsoft/STL/projects/9) in the Microsoft/STL GitHub repository and the [MSVC's STL Completes `/std:c++20`](https://devblogs.microsoft.com/cppblog/msvcs-stl-completes-stdc20/) blog post.
199
216
200
217
- We added various C++23 Library features, available under the **`/std:c++latest`** option. For more information about the new features, see the [STL Repo changelog](https://github.com/microsoft/STL/wiki/Changelog).
201
218
@@ -205,7 +222,7 @@ For a summary of new features and bug fixes in Visual Studio in version 17.2, se
205
222
206
223
For a summary of new features and bug fixes in Visual Studio in version 17.1, see [Visual Studio 2022 version 17.1 Release Notes](/visualstudio/releases/2022/release-notes-v17.1).
207
224
208
-
- A new **Configure Preset** template has been added to configure and build CMake projects on a remote macOS system with *`CMakePresets.json`*. You can also launch CMake targets on a remote macOS system, and then debug remotely in the Visual Studio debugger backed by GDB or LLDB.
225
+
- A new **Configure Preset** template is added to configure and build CMake projects on a remote macOS system with *`CMakePresets.json`*. You can also launch CMake targets on a remote macOS system, and then debug remotely in the Visual Studio debugger backed by GDB or LLDB.
209
226
210
227
- You can now debug core dumps on a remote macOS system from Visual Studio with LLDB or GDB.
211
228
@@ -240,16 +257,12 @@ In Visual Studio 2022, when you start your app in the debugger, you can use the
240
257
241
258
### Improved CMake support
242
259
243
-
- We've upgraded the version of CMake shipped with Visual Studio to version 3.21. For more information on what's available in this version, see the [CMake 3.21 release notes](https://cmake.org/cmake/help/latest/release/3.21.html).
244
-
245
-
- CMake Overview Pages have been updated to support *`CMakePresets.json`*.
260
+
- Upgraded the version of CMake shipped with Visual Studio to version 3.21. For more information on what's available in this version, see the [CMake 3.21 release notes](https://cmake.org/cmake/help/latest/release/3.21.html).
246
261
262
+
- CMake Overview Pages are updated to support *`CMakePresets.json`*.
247
263
- You can now configure and build your CMake projects with CMake 3.21 and *`CMakePresets.json`* v3.
248
-
249
264
- Visual Studio now supports the `buildPresets.targets` option in *`CMakePresets.json`*. This option allows you to build a subset of targets in your CMake project.
250
-
251
-
- The Project menu in CMake projects has been streamlined and exposes options to "Delete Cache and Reconfigure" and "View Cache".
252
-
265
+
- The Project menu in CMake projects is streamlined and exposes options to "Delete Cache and Reconfigure" and "View Cache."
253
266
- Implemented the **`/scanDependencies`** compiler option to list C++20 module dependencies for CMake projects, as described in [P1689R5](https://wg21.link/P1689r5). It's a step towards support for building modules-based projects with CMake and we're working on completing this support in later releases.
254
267
255
268
### Standard Library improvements
@@ -258,8 +271,8 @@ Select Standard Library (STL) improvements are highlighted here. For a comprehen
258
271
259
272
- Added debugging visualizers to improve how the following types are displayed: `source_location`, `bind_front()`, `u8string` (and its iterators), `default_sentinel_t`, `unreachable_sentinel_t`, `ranges::empty_view`, `ranges::single_view`, `ranges::iota_view` (and its iterator/sentinel), `ranges::ref_view`, `thread`, `thread::id`, `jthread`, and `filesystem::path`
260
273
- Added `[[nodiscard]]` to the `stoi()` family of functions in `<string>` and to various functions in `<locale>` such as the `collate` member functions, `has_facet()`, and the `isalnum()` and `tolower()` families.
261
-
-[P0980R1](https://wg21.link/P0980R1) Made `std::string``constexpr` in VS 2019 16.10. Now it's also supported for Clang.
262
-
-[P1004R2](https://wg21.link/P1004R2) Made `std::vector``constexpr`in VS 2019 16.10. Now it's also supported for Clang.
274
+
-[P0980R1](https://wg21.link/P0980R1) Made `std::string``constexpr` in VS 2019 16.10. Now supported for Clang.
275
+
-[P1004R2](https://wg21.link/P1004R2) Made `std::vector``constexpr`in VS 2019 16.10. Now supported for Clang.
263
276
264
277
**Highlighted C++23 features**
265
278
@@ -280,7 +293,7 @@ Select Standard Library (STL) improvements are highlighted here. For a comprehen
280
293
281
294
### Clang and LLVM support
282
295
283
-
- LLVM tools shipped with Visual Studio have been upgraded to LLVM 12. For more information, see the [LLVM release notes](https://releases.llvm.org/12.0.0/docs/ReleaseNotes.html).
296
+
- LLVM tools shipped with Visual Studio are upgraded to LLVM 12. For more information, see the [LLVM release notes](https://releases.llvm.org/12.0.0/docs/ReleaseNotes.html).
284
297
285
298
- Clang-cl support was updated to LLVM 12.
286
299
@@ -310,7 +323,7 @@ Select Standard Library (STL) improvements are highlighted here. For a comprehen
310
323
311
324
- Code analysis now enforces that return values of functions annotated with `_Check_return_` or `_Must_inspect_result_` must be checked.
0 commit comments