{"id":35467,"date":"2025-05-13T17:27:47","date_gmt":"2025-05-13T17:27:47","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/cppblog\/?p=35467"},"modified":"2025-05-14T08:31:37","modified_gmt":"2025-05-14T08:31:37","slug":"whats-new-for-cpp-developers-in-visual-studio-2022-17-14","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/cppblog\/whats-new-for-cpp-developers-in-visual-studio-2022-17-14\/","title":{"rendered":"What\u2019s New for C++ Developers in Visual Studio 2022 17.14"},"content":{"rendered":"<p>Visual Studio 2022 version 17.14 is now generally available! This post summarizes the new features you can find in this release for C++. You can download Visual Studio 2022 from the <a href=\"https:\/\/visualstudio.microsoft.com\/downloads\/\" target=\"_blank\" rel=\"noopener\">Visual Studio downloads page\u00a0<\/a>or upgrade your existing installation by following the\u00a0<a href=\"https:\/\/learn.microsoft.com\/en-us\/visualstudio\/install\/update-visual-studio?view=vs-2022\" target=\"_blank\" rel=\"noopener\">Update Visual Studio Learn page<\/a>.<\/p>\n<h2>Standard Library and Compiler<\/h2>\n<p>We\u2019ve made a myriad of fixes and improvements to the MSVC compiler and standard library. See <a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/c-language-updates-in-msvc-in-visual-studio-2022-17-14\/\">C++ Language Updates in MSVC in Visual Studio 2022 17.14 <\/a>for a full list of changes on the compiler side, and the <a href=\"https:\/\/github.com\/microsoft\/STL\/wiki\/Changelog\">STL Changelog<\/a> for all the standard library updates.<\/p>\n<h3>Compiler<\/h3>\n<p>We\u2019ve added support for several C++23 features, which are available under the <code>\/std:c++latest<\/code> and <code>\/std:c++23preview<\/code> flags.<\/p>\n<p>You can now omit <code>()<\/code> in some forms of lambdas that previously required them, thanks to <a href=\"https:\/\/www.open-std.org\/jtc1\/sc22\/wg21\/docs\/papers\/2020\/p1102r2.html\" target=\"_blank\" rel=\"noopener\">P1102R2<\/a>:<\/p>\n<pre class=\"prettyprint language-cpp\"><code class=\"language-cpp\">auto lambda = [] constexpr { }; \/\/no '()' needed after the capture list<\/code><\/pre>\n<p>We implemented <code><a href=\"https:\/\/www.open-std.org\/jtc1\/sc22\/wg21\/docs\/papers\/2021\/p1938r3.html\">if consteval<\/a><\/code>, with which you can run different code depending on whether the statement is executed at compile time or run time. This is useful for cases where your run time version can be heavily optimized with compiler intrinsics or inline assembly that are not available at compile time:<\/p>\n<pre class=\"prettyprint language-cpp\"><code class=\"language-cpp\">constexpr size_t strlen(char const* s) {\r\n    if consteval {\r\n        \/\/ if executed at compile time, use a constexpr-friendly algorithm\r\n        for (const char *p = s; ; ++p) {\r\n            if (*p == '\\0') {\r\n                return static_cast&lt;std::size_t&gt;(p - s);\r\n            }\r\n        }\r\n    } else {\r\n        \/\/ if executed at run time, use inline assembly\r\n        __asm__(\"SSE 4.2 magic\");\r\n    }\r\n}\r\n<\/code><\/pre>\n<p>We now support <a href=\"https:\/\/www.open-std.org\/jtc1\/sc22\/wg21\/docs\/papers\/2021\/p2173r1.pdf\">attributes for lambdas<\/a>:<\/p>\n<pre class=\"prettyprint language-default\"><code class=\"language-cpp\">auto lambda = [] [[nodiscard]] [[deprecated]] { return 10; };\r\n\r\nvoid f() {\r\n    lambda(); \/\/ fires a deprecation warning and a discard of return value warning.\r\n}<\/code><\/pre>\n<p>We also now support <code><a href=\"https:\/\/www.open-std.org\/jtc1\/sc22\/wg21\/docs\/papers\/2022\/p1169r4.html\">static operator()<\/a><\/code> and <code><a href=\"https:\/\/www.open-std.org\/jtc1\/sc22\/wg21\/docs\/papers\/2022\/p2589r1.pdf\">static operator[]<\/a><\/code>. These allow the compiler to generate more efficient code for these operators when the implicit object parameter is not needed and therefore does not need to be passed as an argument to the function:<\/p>\n<pre class=\"prettyprint language-cpp\"><code class=\"language-cpp\">struct X {\r\n    static bool operator()(int) const;\r\n};\r\n\r\ninline constexpr X x;\r\n\r\nint count_x(std::vector&lt;int&gt; const&amp; xs) {\r\n    return std::count_if(xs.begin(), xs.end(), x);\r\n}<\/code><\/pre>\n<p>The performance of generated code improved due to 17.14 including earlier SSA optimizations and control-flow simplifications. The 17.14 compiler emits 20% faster code than the initial Visual Studio 2022 17 release.<\/p>\n<p>For throughput, the 17.14 compiler incorporates a dataflow simplification that reduced the compile time of an UnrealEngine <code>\/LTCG<\/code> link repro by 13%.<\/p>\n<h3>Standard Library<\/h3>\n<p>We have implemented parts of <a href=\"https:\/\/www.open-std.org\/jtc1\/sc22\/wg21\/docs\/papers\/2025\/p3471r4.html\">standard library hardening<\/a>, which checks for some instances of undefined behavior at runtime and reports them to the user. This is currently disabled by default, but you can enable it by defining <code>_MSVC_STL_HARDENING<\/code> to 1 project-wide. The proposal uses C++26 contract violations as the mechanism for reporting hardened precondition violations, but since we haven\u2019t implemented contracts yet, we default to calling <code>__fastfail()<\/code>.<\/p>\n<p>Another new safety feature we have added is destructor tombstones, which help mitigate use-after-free mistakes. This is also disabled by default, but can be enabled by defining <code>_MSVC_STL_DESTRUCTOR_TOMBSTONES<\/code> to 1 project-wide.<\/p>\n<p>Some miscellaneous improvements we have made are:<\/p>\n<ul>\n<li>We now take advantage of our compiler support for <code>static operator()<\/code>, which gives slightly improved codegen.<\/li>\n<li>We marked <code>std::expected<\/code>, <code>std::unexpected<\/code>, and all STL exception types as <code>[[nodiscard]]<\/code>. This will help protect you from misusing them.<\/li>\n<li>Improved the visualizers for <code>std::basic_string_view<\/code> and its iterators.<\/li>\n<li>Added or improved vectorized implementations of <code>std::basic_string::find()<\/code>, <code>find_first_of()<\/code>, and <code>find_last_of()<\/code>.<\/li>\n<\/ul>\n<h2>C++ Dynamic Debugging<\/h2>\n<p>C++ Dynamic Debugging is a new compiler and IDE feature that gives you the performance of optimized builds with the debugging experience of unoptimized builds. It is now available as a\u00a0<em>preview<\/em>\u00a0feature exclusively with the MSVC toolset and works by dynamically deoptimizing functions that you set deoptimized breakpoints on or step into.<\/p>\n<p>For example, without C++ Dynamic Debugging, you might see this in your Watch window:<\/p>\n<p><img decoding=\"async\" width=\"481\" height=\"301\" class=\"wp-image-35468\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2025\/05\/image-before.png\" alt=\"Image before\" srcset=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2025\/05\/image-before.png 481w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2025\/05\/image-before-300x188.png 300w\" sizes=\"(max-width: 481px) 100vw, 481px\" \/><\/p>\n<p>Many of the variables are unavailable, so the debugger cannot visualize them.<\/p>\n<p>When you enable the feature, however, you\u2019ll see this:<\/p>\n<p><img decoding=\"async\" width=\"508\" height=\"267\" class=\"wp-image-35469\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2025\/05\/image-after.png\" alt=\"Image after\" srcset=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2025\/05\/image-after.png 508w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2025\/05\/image-after-300x158.png 300w\" sizes=\"(max-width: 508px) 100vw, 508px\" \/><\/p>\n<p>The values of the variables are now available because the function has been dynamically deoptimized.<\/p>\n<p>To begin, change your configuration to Release mode. Next, right-click on your project and click on Properties to open the Configuration Properties menu. In this menu, click on\u00a0<em>Advanced<\/em>\u00a0&gt;\u00a0<em>Use C++ Dynamic Debugging<\/em>\u00a0&gt;\u00a0<strong>Yes<\/strong>. Lastly, rebuild your project. Setting this property will turn off Whole Program Optimization.<\/p>\n<p><img decoding=\"async\" width=\"624\" height=\"212\" class=\"wp-image-35470\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2025\/05\/screenshot-of-configuration-properties-activating.png\" alt=\"screenshot of configuration properties activating C++ dynamic debugging\" srcset=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2025\/05\/screenshot-of-configuration-properties-activating.png 624w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2025\/05\/screenshot-of-configuration-properties-activating-300x102.png 300w\" sizes=\"(max-width: 624px) 100vw, 624px\" \/><\/p>\n<p>For all the details about C++ Dynamic Debugging, see <a href=\"https:\/\/learn.microsoft.com\/visualstudio\/debugger\/cpp-dynamic-debugging\">our documentation<\/a>.<\/p>\n<h2>IDE<\/h2>\n<p>You can now automatically populate template arguments in the template bar, which displays and allows editing of template parameters, when using\u00a0<strong>Go to Definition<\/strong>\u00a0or\u00a0F12.<\/p>\n<p>For example, pressing F12 on\u00a0vector\u00a0will now jump to\u00a0vector\u00a0with the template bar automatically populated, allowing you to quickly inspect and modify template parameters.<\/p>\n<p>In the example below, using\u00a0<strong>Go To Definition<\/strong>\u00a0or pressing\u00a0F12\u00a0will populate both the type and allocator in the template bar.<\/p>\n<p><img decoding=\"async\" width=\"800\" height=\"305\" class=\"wp-image-35471\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2025\/05\/auto-populate-template-intellisense.gif\" alt=\"Auto Populate Template IntelliSense\" \/><\/p>\n<p>We\u2019ve also added support for controlling which headers appear in the include completion list when you type\u00a0#include.<\/p>\n<p>The dropdown setting in\u00a0<strong>Tools \u2192 Options \u2192 Text Editor \u2192 C\/C++ \u2192 IntelliSense \u2192 Include style for suggestions<\/strong>\u00a0now affects both include suggestions and include completion, with the following refined behaviors:<\/p>\n<ul>\n<li><strong>Core Guidelines (Default)<\/strong>: Uses quotes for relative paths and angle brackets for everything else.<\/li>\n<li><strong>Quotes mode<\/strong>: Uses quotes for all headers except standard headers, which use angle brackets.<\/li>\n<li><strong>Angle brackets mode<\/strong>: Uses angle brackets for all headers that are part of the include path.<\/li>\n<\/ul>\n<p><img decoding=\"async\" width=\"736\" height=\"476\" class=\"wp-image-35472\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2025\/05\/include-style-for-suggestions-setting.png\" alt=\"Include Style for Suggestions Setting\" srcset=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2025\/05\/include-style-for-suggestions-setting.png 736w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2025\/05\/include-style-for-suggestions-setting-300x194.png 300w\" sizes=\"(max-width: 736px) 100vw, 736px\" \/><\/p>\n<h2>CMake<\/h2>\n<p>We have added support for IntelliSense-based completions and quick info for CMake modules in Visual Studio. Now, you can view all available CMake modules and learn more about them directly from the Visual Studio editor.<\/p>\n<h3>Quick Info<\/h3>\n<p>When you hover over a referenced CMake module, IntelliSense provides detailed information about the selected module, helping you understand its usage and functionality at a glance.<\/p>\n<p><img decoding=\"async\" width=\"787\" height=\"108\" class=\"wp-image-35473\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2025\/05\/cmake-information-in-the-quick-info.png\" alt=\"CMake information in the Quick Info\" srcset=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2025\/05\/cmake-information-in-the-quick-info.png 787w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2025\/05\/cmake-information-in-the-quick-info-300x41.png 300w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2025\/05\/cmake-information-in-the-quick-info-768x105.png 768w\" sizes=\"(max-width: 787px) 100vw, 787px\" \/><\/p>\n<h3>Completion<\/h3>\n<p>When you start typing a CMake module in your\u00a0CMakeLists.txt\u00a0or other CMake script files, IntelliSense will provide a list of available modules to choose from.<\/p>\n<p><img decoding=\"async\" width=\"369\" height=\"310\" class=\"wp-image-35474\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2025\/05\/cmake-module-completion.png\" alt=\"CMake module completion\" srcset=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2025\/05\/cmake-module-completion.png 369w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2025\/05\/cmake-module-completion-300x252.png 300w\" sizes=\"(max-width: 369px) 100vw, 369px\" \/><\/p>\n<h2>GitHub Copilot<\/h2>\n<p>We\u2019ve added doc comment generation support for GitHub Copilot. With this feature enabled, you can type the comment pattern according to your settings configuration (e.g.,\u00a0<code>\/\/\/<\/code>), and Copilot will complete the function description based on the code.<\/p>\n<p><img decoding=\"async\" width=\"768\" height=\"295\" class=\"wp-image-35475\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2025\/05\/ai-doc-comments.gif\" alt=\"AI doc comments\" \/><\/p>\n<p>Also new in this release is Next Edit Suggestions (NES). When you&#8217;re presented with an edit suggestion, if it is on a different line than the one you are on now, it will suggest you\u00a0<strong>Tab to Navigate to the corresponding line<\/strong>\u00a0first.<\/p>\n<p>You can enable NES at<strong> Tools \u2192 Options \u2192 GitHub \u2192 Copilot \u2192 Copilot Completions \u2192 Enable Next Edit Suggestions.<\/strong><\/p>\n<p><img decoding=\"async\" width=\"642\" height=\"311\" class=\"wp-image-35476\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2025\/05\/nes-tab-to-jump-hint-bar.png\" alt=\"NES Tab to Jump Hint Bar\" srcset=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2025\/05\/nes-tab-to-jump-hint-bar.png 642w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2025\/05\/nes-tab-to-jump-hint-bar-300x145.png 300w\" sizes=\"(max-width: 642px) 100vw, 642px\" \/><\/p>\n<h2>Unreal Engine Blueprints Debugger<\/h2>\n<p>The Unreal Engine Blueprint integration allows you to debug Blueprints directly within Visual Studio. This integration includes displaying Blueprint stack traces in the Visual Studio call stack tab and showing Blueprint node values in the local variables table. These features limit the need for you to switch between Visual Studio and the Unreal Editor, providing a seamless debugging experience and reducing context-switching.<\/p>\n<p><img decoding=\"async\" width=\"860\" height=\"230\" class=\"wp-image-35477\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2025\/05\/picture-1-picture.png\" alt=\"Picture 1, Picture\" srcset=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2025\/05\/picture-1-picture.png 860w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2025\/05\/picture-1-picture-300x80.png 300w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2025\/05\/picture-1-picture-768x205.png 768w\" sizes=\"(max-width: 860px) 100vw, 860px\" \/><\/p>\n<p>With the new functionality, developers can easily track interactions between Blueprints and C++ code, making it simpler to identify and fix bugs. Additionally, an <a href=\"https:\/\/github.com\/microsoft\/vc-ue-extensions\">Unreal Engine plugin for Visual Studio<\/a> enhances this capability by tracking Blueprint execution flow and storing additional information, which the debugger extension can then display.<\/p>\n<h2>Address Sanitizer<\/h2>\n<p>We have resolved various issues and feedback tickets, enhancing the quality and stability of Address Sanitizer. We have published a comprehensive list of issues we resolved in Visual Studio 2022 17.13 <a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/msvc-address-sanitizer-updates-in-visual-studio-2022-version-17-13\/\">here<\/a> and will publish a similar one for 17.14 soon.<\/p>\n<p>To further improve the quality of both Address Sanitizer and our toolchain, we now instrument the entire toolchain with Address Sanitizer on each pull request. Then, internal test pipelines are executed against this instrumented toolset to protect against memory safety errors. This process enables the identification of novel memory safety issues within the toolset and improves the quality of Address Sanitizer through an expedited feedback loop. The Visual C++ Library implementation in the <a href=\"https:\/\/github.com\/Microsoft\/STL\">STL GitHub repository<\/a> is also tested daily using Address Sanitizer using a <a href=\"https:\/\/dev.azure.com\/vclibs\/STL\/_build?definitionId=5&amp;_a=summary\">dedicated pipeline<\/a>.<\/p>\n<h2>Send us your feedback<\/h2>\n<p>We are very much interested in your feedback to continue to improve this experience. The comments below are open. Feedback can also be shared through\u00a0<a href=\"https:\/\/developercommunity.visualstudio.com\/cpp\" target=\"_blank\" rel=\"noopener\">Visual Studio Developer Community<\/a>. You can also reach us via email at\u00a0<a href=\"mailto:visualcpp@microsoft.com\">visualcpp@microsoft.com<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Visual Studio 2022 version 17.14 is now generally available! This post summarizes the new features you can find in this release for C++. You can download Visual Studio 2022 from the Visual Studio downloads page\u00a0or upgrade your existing installation by following the\u00a0Update Visual Studio Learn page. Standard Library and Compiler We\u2019ve made a myriad of [&hellip;]<\/p>\n","protected":false},"author":706,"featured_media":35994,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[270,1],"tags":[],"class_list":["post-35467","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-announcement","category-cplusplus"],"acf":[],"blog_post_summary":"<p>Visual Studio 2022 version 17.14 is now generally available! This post summarizes the new features you can find in this release for C++. You can download Visual Studio 2022 from the Visual Studio downloads page\u00a0or upgrade your existing installation by following the\u00a0Update Visual Studio Learn page. Standard Library and Compiler We\u2019ve made a myriad of [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/35467","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/users\/706"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/comments?post=35467"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/35467\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/media\/35994"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/media?parent=35467"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/categories?post=35467"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/tags?post=35467"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}