Skip to content

Commit 766d87a

Browse files
Taojunshen3836425+corob-msft@users.noreply.github.comopbld16TylerMSFTTylerMSFT
authored
2/16/2021 AM Publish (MicrosoftDocs#4104)
* Change __STDC__ documentation for 17.2 * Twhitney updateui (#4082) * update ui steps * simplify * fix formatting * try a note * formatting * bridge the note * edits * edits * acrolinx * Update docs/build/walkthrough-header-units.md Co-authored-by: TylerMSFT <Tyler.Whitney@microsoft.com> Co-authored-by: Shannon Leavitt <V-SHLEAV@microsoft.com> * Fix link to CreateProcess function * Update exception-handling-x64.md * US1907300 - add md code escapes to code elements - PR9 * Address cpp-docs 3691, 3688, 3684, 3664 (MicrosoftDocs#4085) * [17.2p1] Add /scanDependencies option to docs (MicrosoftDocs#4059) * Add /scanDependencies option to docs * Acrolinx pass * Updates per review by Cameron * Consistency of command option formatting * Add IDE instructions * Tweaks per comments. * US1907300 - add md code escapes to code elements - PR7 (MicrosoftDocs#4076) * US1907300 - add md code escapes to code elements - PR7 * US1907300 - add md code escapes to code elements - PR7 * updates after review * updates after review * updates after review * updates after review * updates after review * US1907300 - add md code escapes to code elements - PR8 (MicrosoftDocs#4080) * US1907300 - add md code escapes to code elements - PR8 * updates after review * updates after review * updates after review * fix blocking issue * Address DD 1462641 (MicrosoftDocs#4086) * Content for 17.1 release * US1907300 - add md code escapes to code elements - PR9 * fix formatting issue * US1907300 - add md code escapes to code elements - PR10 * updates after review * updates after review * updates after review * updates after review * updates after review * Address cpp-docs 3694, 3696 * Update what-s-new-for-visual-cpp-in-visual-studio.md fix typo * add links (#4094) Co-authored-by: TylerMSFT <Tyler.Whitney@microsoft.com> * Address cpp-docs 3694, 3696 (#4091) * Updates for cpp-docs 3700 3703 * Add op= to example * Add 3448,3482,3483,3540,3683 updates * Use existing media for CMake Targets View * US1907300 - add md code escapes to code elements - PR11 (MicrosoftDocs#4095) * US1907300 - add md code escapes to code elements - PR11 * updates after review * fix table syntax * trying to fix table rendering error * trying to fix table rendering error * trying to fix table rendering error * update after review * Additional clean-up for DD 1462641 * Set ms.topic: faq where YamlMime:FAQ (MicrosoftDocs#4099) * Release notes and conformance for 17.1 * typo fix Co-authored-by: 3836425+corob-msft@users.noreply.github.com <corob@microsoft.com> Co-authored-by: opbld16 <opbld16@microsoft.com> Co-authored-by: Tyler Whitney <TylerMSFT@users.noreply.github.com> Co-authored-by: TylerMSFT <Tyler.Whitney@microsoft.com> Co-authored-by: Shannon Leavitt <V-SHLEAV@microsoft.com> Co-authored-by: ishchukin <78567572+ishchukin@users.noreply.github.com> Co-authored-by: p4yl0ad <57832389+p4yl0ad@users.noreply.github.com> Co-authored-by: opbld17 <opbld17@microsoft.com> Co-authored-by: Craig Casey <17149610+craigcaseyMSFT@users.noreply.github.com> Co-authored-by: PRMerger9 <prmrgr9@microsoft.com> Co-authored-by: opbld15 <opbld15@microsoft.com> Co-authored-by: Dennis Rea <v-denrea@microsoft.com> Co-authored-by: jason <drvoss@gmail.com> Co-authored-by: Linda Spiller <93278958+LJSpiller@users.noreply.github.com> Co-authored-by: Alex Buck <abuck@microsoft.com>
1 parent f29d163 commit 766d87a

8 files changed

+137
-20
lines changed

docs/atl/atl-control-containment-faq.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ metadata:
55
ms.date: "11/04/2016"
66
helpviewer_keywords: ["hosting controls using ATL", "ActiveX control containers [C++], ATL control hosting", "ATL, hosting ActiveX controls", "ActiveX controls [C++], hosting", "controls [ATL]"]
77
ms.assetid: d4bdfbe0-82ca-4f2f-bb95-cb89bdcc9b53
8-
8+
ms.topic: faq
99
title: ATL Control Containment FAQ
1010
summary: |
1111
@@ -119,4 +119,4 @@ additionalContent: |
119119
[AtlAxCreateControlLic](reference/composite-control-global-functions.md#atlaxcreatecontrollic)<br/>
120120
[AtlAxCreateControlLicEx](reference/composite-control-global-functions.md#atlaxcreatecontrolex)<br/>
121121
[CAxWindow2T Class](../atl/reference/caxwindow2t-class.md)<br/>
122-
[IAxWinHostWindowLic Interface](../atl/reference/iaxwinhostwindowlic-interface.md)
122+
[IAxWinHostWindowLic Interface](../atl/reference/iaxwinhostwindowlic-interface.md)

docs/build/dll-frequently-asked-questions.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ metadata:
55
ms.date: "05/06/2019"
66
helpviewer_keywords: ["troubleshooting [C++], DLLs", "DLLs [C++], frequently asked questions", "FAQs [C++], DLLs"]
77
ms.assetid: 09dd068e-fc33-414e-82f7-289c70680256
8-
8+
ms.topic: faq
99
title: DLL frequently asked questions
1010
summary: |
1111

docs/build/reference/compiler-options-listed-alphabetically.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ This table contains an alphabetical list of compiler options. For a list of comp
111111
| [`/homeparams`](homeparams-copy-register-parameters-to-stack.md) | Forces parameters passed in registers to be written to their locations on the stack upon function entry. This compiler option is only for the x64 compilers (native and cross compile). |
112112
| [`/hotpatch`](hotpatch-create-hotpatchable-image.md) | Creates a hotpatchable image. |
113113
| [`/I<dir>`](i-additional-include-directories.md) | Searches a directory for include files. |
114+
| **`/ifcOutput`** | Specify output file or directory for *`.ifc`* files. |
114115
| [`/J`](j-default-char-type-is-unsigned.md) | Changes the default **`char`** type. |
115116
| [`/JMC`](jmc.md) | Supports native C++ Just My Code debugging. |
116117
| [`/kernel`](kernel-create-kernel-mode-binary.md) | The compiler and linker will create a binary that can be executed in the Windows kernel. |

docs/build/reference/compiler-options-listed-by-category.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,9 @@ This article contains a categorical list of compiler options. For an alphabetica
135135
| Option | Purpose |
136136
|--|--|
137137
| [`/exportHeader`](module-exportheader.md) | Create the header units files (*`.ifc`*) specified by the input arguments. |
138-
| [`/headerUnit`](headerunit.md) | Specify where to find the header unit file (`.ifc`) for the specified header. |
138+
| [`/headerUnit`](headerunit.md) | Specify where to find the header unit file (*`.ifc`*) for the specified header. |
139139
| [`/headerName`](headername.md) | Build a header unit from the specified header. |
140+
| **`/ifcOutput`** | Specify output file or directory for *`.ifc`* files. |
140141
| [`/reference`](module-reference.md) | Use named module IFC. |
141142
| [`/scanDependencies`](scandependencies.md) | List module and header unit dependencies in C++ Standard JSON form. |
142143
| [`/sourceDependencies`](sourcedependencies.md) | List all source-level dependencies. |

docs/overview/cpp-conformance-improvements.md

Lines changed: 87 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,93 @@ Microsoft C/C++ in Visual Studio (MSVC) makes conformance improvements and bug f
1010

1111
This document lists the changes in Visual Studio 2022. For a guide to the changes in Visual Studio 2019, see [C++ conformance improvements in Visual Studio 2019](cpp-conformance-improvements-2019.md). For changes in Visual Studio 2017, see [C++ conformance improvements in Visual Studio 2017](cpp-conformance-improvements-2017.md). For a complete list of previous conformance improvements, see [Visual C++ What's New 2003 through 2015](../porting/visual-cpp-what-s-new-2003-through-2015.md).
1212

13-
## <a name="improvements_170_preview"></a> Conformance improvements in Visual Studio 2022 version 17.0
13+
## <a name="improvements_171"></a> Conformance improvements in Visual Studio 2022 version 17.1
14+
15+
Visual Studio 2022 version 17.1 contains the following conformance improvements, bug fixes, and behavior changes in the Microsoft C++ compiler.
16+
17+
### Detect ill-formed capture default in non-local lambda-expressions
18+
19+
The C++ Standard only allows a lambda expression in block scope to have a capture-default. In Visual C++ 2022 version 17.1 and later, the compiler now detects when a capture default isn't allowed in a non-local lambda expression and emits a new level 4 warning, C5253.
20+
21+
This change is a source breaking change. It applies in any mode that uses the new lambda processor: **`/Zc:lambda`**, **`/std:c++20`**, or **`/std:c++latest`**.
22+
23+
#### Example
24+
25+
In Visual C++ 2022 version 17.1 this code now emits an error:
26+
27+
```cpp
28+
#pragma warning(error:5253)
29+
30+
auto incr = [=](int value) { return value + 1; };
31+
32+
// capture_default.cpp(3,14): error C5253: a non-local lambda cannot have a capture default
33+
// auto incr = [=](int value) { return value + 1; };
34+
// ^
35+
```
36+
37+
To fix this issue, remove the capture default:
38+
39+
```cpp
40+
#pragma warning(error:5253)
41+
42+
auto incr = [](int value) { return value + 1; };
43+
```
44+
45+
### C4028 is now C4133 for function-to-pointer operations
46+
47+
Before Visual Studio 2022 version 17.1, the compiler reported an incorrect error message on certain pointer-to-function comparisons in C code. The incorrect message was reported when you compared two function pointers that had the same argument counts but incompatible types. Now, we issue a different warning that complains about pointer-to-function incompatibility rather than function parameter mismatch.
48+
49+
This change is a source breaking change. It applies when code is compiled as C.
50+
51+
#### Example
52+
53+
```C
54+
int f1(int);
55+
int f2(char*);
56+
int main(void)
57+
{
58+
return (f1 == f2);
59+
}
60+
// Old warning:
61+
// C4028: formal parameter 1 different from declaration
62+
// New warning:
63+
// C4113: 'int (__cdecl *)(char *)' differs in parameter lists from 'int (__cdecl *)(int)'
64+
```
65+
66+
### Error on a non-dependent static_assert
67+
68+
In Visual Studio 2022 version 17.1 and later, if the expression associated with a `static_assert` is not dependent, the compiler evaluates the expression as soon as it's parsed. If the expression evaluates to `false`, the compiler emits an error. Previously, if the `static_assert` was within the body of a function template (or within the body of a member function of a class template), the compiler wouldn't perform this analysis.
69+
70+
This change is a source breaking change. It applies in any mode that implies **`/Zc:permissive-`** or **`/Zc:static_assert`**. This change in behavior can be disabled by using the **`/Zc:static_assert-`** compiler option.
71+
72+
#### Example
73+
74+
In Visual Studio 2022 version 17.1 and later, this code now causes an error:
75+
76+
```cpp
77+
template<typename T>
78+
void f()
79+
{
80+
static_assert(false, "BOOM!");
81+
}
82+
```
83+
84+
To fix this issue, make the expression dependent. For example:
85+
86+
```cpp
87+
template<typename>
88+
constexpr bool dependent_false = false;
89+
90+
template<typename T>
91+
void f()
92+
{
93+
static_assert(dependent_false<T>, "BOOM!");
94+
}
95+
```
96+
97+
With this change, the compiler only emits an error if the function template `f` is instantiated.
98+
99+
## <a name="improvements_170"></a> Conformance improvements in Visual Studio 2022 version 17.0
14100

15101
Visual Studio 2022 version 17.0 contains the following conformance improvements, bug fixes, and behavior changes in the Microsoft C++ compiler.
16102

docs/overview/what-s-new-for-visual-cpp-in-visual-studio.md

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,30 @@
11
---
22
title: "What's new for C++ in Visual Studio"
33
description: "The new features and fixes in the Microsoft C/C++ compiler and tools in Visual Studio."
4-
ms.date: 11/05/2021
4+
ms.date: 02/15/2022
55
ms.technology: "cpp-ide"
66
ms.custom: intro-whats-new
77
---
88
# What's new for C++ in Visual Studio 2022
99

1010
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. For more information on what's new in all of Visual Studio, visit [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).
1111

12+
## What's new for C++ in Visual Studio version 17.1
13+
14+
For a summary of new features and bug fixes in Visual Studio, see [What's New in Visual Studio 2022 version 17.1](/visualstudio/releases/2022/release-notes).
15+
16+
- 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.
17+
18+
- You can now debug core dumps on a remote macOS system from Visual Studio with LLDB or GDB.
19+
20+
- The versions of [`Clang`](https://releases.llvm.org/13.0.0/tools/clang/docs/ReleaseNotes.html) and [`LLVM`](https://releases.llvm.org/13.0.0/docs/ReleaseNotes.html) shipped with Visual Studio have been upgraded to v13.
21+
22+
- Visual Studio's CMake integration is only active when a *`CMakeLists.txt`* is identified at the root of the open workspace. If a *`CMakeLists.txt`* is identified at another level of the workspace, then you'll be prompted to activate Visual Studio's CMake integration with a notification.
23+
24+
- Added a new register visualization window for embedded targets, available through **Debug** > **Windows** > **Embedded Registers**.
25+
26+
- Added a new thread view for RTOS projects, available through **Debug** > **Windows** > **RTOS Objects**.
27+
1228
## What's new for C++ in Visual Studio version 17.0
1329

1430
For a summary of new features and bug fixes in Visual Studio, see [What's New in Visual Studio 2022 version 17.0](/visualstudio/releases/2022/release-notes).
@@ -61,14 +77,14 @@ Select Standard Library (STL) improvements are highlighted here. For a comprehen
6177
- [P1679R3](https://wg21.link/P1679R3) `contains()` For `basic_string` and `basic_string_view`
6278
- [P1682R3](https://wg21.link/P1682R3) `to_underlying()` for enumerations
6379
- [P2162R2](https://wg21.link/P2162R2) Allow inheriting from `std::variant`
64-
- [P2166R1](https://wg21.link/P2166R1) Prohibit constructing`basic_string` and `basic_string_view` from `nullptr`. This is a source-breaking change. Code that previously had undefined behavior at runtime will now be rejected with compiler errors.
65-
- [P2186R2](https://wg21.link/P2186R2) Removed garbage collection support. This removes `declare_reachable`, `undeclare_reachable`, `declare_no_pointers`, `undeclare_no_pointers`, `get_pointer_safety`. Previously, these functions had no effect.
80+
- [P2166R1](https://wg21.link/P2166R1) Prohibit constructing`basic_string` and `basic_string_view` from `nullptr`. This change is a source-breaking change. Code that previously had undefined behavior at runtime is now rejected with compiler errors.
81+
- [P2186R2](https://wg21.link/P2186R2) Removed garbage collection support. This change removes `declare_reachable`, `undeclare_reachable`, `declare_no_pointers`, `undeclare_no_pointers`, `get_pointer_safety`. Previously, these functions had no effect.
6682

6783
**Highlighted performance improvements**
6884

6985
- `<format>` now detects when it's writing to a `back_insert_iterator` for a `basic_string` or a `vector`, and makes a faster call to `insert()` at the `end()` of the container.
70-
- Improved the performance of `std::find()` and `std::count()` for `vector<bool>` 19x and 26x (times, not percent).
71-
- Improved the performance of `std::count()` for `vector<bool>`
86+
- We improved the performance of `std::find()` and `std::count()` for `vector<bool>` 19x and 26x (times, not percent).
87+
- We improved the performance of `std::count()` for `vector<bool>`
7288
- `std::byte` now has the same performance as `unsigned char` in `reverse()` and `variant::swap()`
7389

7490
### Clang and LLVM support
@@ -87,7 +103,7 @@ Select Standard Library (STL) improvements are highlighted here. For a comprehen
87103

88104
- We made improvements in C++ IntelliSense when providing navigation and syntax highlighting for types from imported Modules and Header Units. IntelliSense is an active area of investment for us. Help us improve: Share your feedback on Developer Community by using **Help** > **Send Feedback**.
89105

90-
- Improved C++ IntelliSense performance by optimizing cached header usage and symbol database access, providing improved load times to get into your code.
106+
- We improved C++ IntelliSense performance by optimizing cached header usage and symbol database access, providing improved load times to get into your code.
91107

92108
- The IntelliSense Code Linter for C++ is now on by default, providing instant as-you-type suggestions and fix suggestions for common code defects.
93109

@@ -117,7 +133,7 @@ Release notes for older C++ versions are also available. For information on what
117133

118134
**C++ IntelliSense**
119135

120-
- [When importing a C++20 module or header unit, IntelliSense may stop working or 'There are too many errors' error is shown](https://aka.ms/vcmoduleintellisenseinfo).
136+
- [`When importing a C++20 module or header unit, IntelliSense may stop working or 'There are too many errors' error is shown`](https://aka.ms/vcmoduleintellisenseinfo).
121137

122138
For more information on other open issues and available workarounds for C++ in Visual Studio 2022, see the C++ Developer Community [issues list](https://developercommunity.visualstudio.com/search?space=62&stateGroup=active&ftype=problem&sort=votes&q=2022).
123139

docs/windows/attributes/attribute-programming-faq.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@ metadata:
33
description: "Learn more about: Attribute programming FAQ"
44
title: "Attribute Programming FAQ"
55
ms.date: "10/02/2018"
6-
ms.topic: "conceptual"
6+
ms.topic: faq
77
helpviewer_keywords: ["attributed programming", "attributes [C++/CLI], frequently asked questions", "FAQs (frequently asked questions), attributed programming [C++]"]
88
ms.assetid: a1b8349f-7f51-43c4-95ea-4edb6e5f243f
9-
109
title: Attribute programming FAQ
1110
summary: |
1211

0 commit comments

Comments
 (0)