Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/atl/atl-control-containment-faq.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
ms.date: "11/04/2016"
helpviewer_keywords: ["hosting controls using ATL", "ActiveX control containers [C++], ATL control hosting", "ATL, hosting ActiveX controls", "ActiveX controls [C++], hosting", "controls [ATL]"]
ms.assetid: d4bdfbe0-82ca-4f2f-bb95-cb89bdcc9b53
ms.topic: faq
title: ATL Control Containment FAQ
summary: |

Expand Down Expand Up @@ -119,4 +119,4 @@ additionalContent: |
[AtlAxCreateControlLic](reference/composite-control-global-functions.md#atlaxcreatecontrollic)<br/>
[AtlAxCreateControlLicEx](reference/composite-control-global-functions.md#atlaxcreatecontrolex)<br/>
[CAxWindow2T Class](../atl/reference/caxwindow2t-class.md)<br/>
[IAxWinHostWindowLic Interface](../atl/reference/iaxwinhostwindowlic-interface.md)
[IAxWinHostWindowLic Interface](../atl/reference/iaxwinhostwindowlic-interface.md)
2 changes: 1 addition & 1 deletion docs/build/dll-frequently-asked-questions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
ms.date: "05/06/2019"
helpviewer_keywords: ["troubleshooting [C++], DLLs", "DLLs [C++], frequently asked questions", "FAQs [C++], DLLs"]
ms.assetid: 09dd068e-fc33-414e-82f7-289c70680256
ms.topic: faq
title: DLL frequently asked questions
summary: |

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ This table contains an alphabetical list of compiler options. For a list of comp
| [`/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). |
| [`/hotpatch`](hotpatch-create-hotpatchable-image.md) | Creates a hotpatchable image. |
| [`/I<dir>`](i-additional-include-directories.md) | Searches a directory for include files. |
| **`/ifcOutput`** | Specify output file or directory for *`.ifc`* files. |
| [`/J`](j-default-char-type-is-unsigned.md) | Changes the default **`char`** type. |
| [`/JMC`](jmc.md) | Supports native C++ Just My Code debugging. |
| [`/kernel`](kernel-create-kernel-mode-binary.md) | The compiler and linker will create a binary that can be executed in the Windows kernel. |
Expand Down
3 changes: 2 additions & 1 deletion docs/build/reference/compiler-options-listed-by-category.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,9 @@ This article contains a categorical list of compiler options. For an alphabetica
| Option | Purpose |
|--|--|
| [`/exportHeader`](module-exportheader.md) | Create the header units files (*`.ifc`*) specified by the input arguments. |
| [`/headerUnit`](headerunit.md) | Specify where to find the header unit file (`.ifc`) for the specified header. |
| [`/headerUnit`](headerunit.md) | Specify where to find the header unit file (*`.ifc`*) for the specified header. |
| [`/headerName`](headername.md) | Build a header unit from the specified header. |
| **`/ifcOutput`** | Specify output file or directory for *`.ifc`* files. |
| [`/reference`](module-reference.md) | Use named module IFC. |
| [`/scanDependencies`](scandependencies.md) | List module and header unit dependencies in C++ Standard JSON form. |
| [`/sourceDependencies`](sourcedependencies.md) | List all source-level dependencies. |
Expand Down
88 changes: 87 additions & 1 deletion docs/overview/cpp-conformance-improvements.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,93 @@ Microsoft C/C++ in Visual Studio (MSVC) makes conformance improvements and bug f

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).

## <a name="improvements_170_preview"></a> Conformance improvements in Visual Studio 2022 version 17.0
## <a name="improvements_171"></a> Conformance improvements in Visual Studio 2022 version 17.1

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

### Detect ill-formed capture default in non-local lambda-expressions

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.

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`**.

#### Example

In Visual C++ 2022 version 17.1 this code now emits an error:

```cpp
#pragma warning(error:5253)

auto incr = [=](int value) { return value + 1; };

// capture_default.cpp(3,14): error C5253: a non-local lambda cannot have a capture default
// auto incr = [=](int value) { return value + 1; };
// ^
```

To fix this issue, remove the capture default:

```cpp
#pragma warning(error:5253)

auto incr = [](int value) { return value + 1; };
```

### C4028 is now C4133 for function-to-pointer operations

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.

This change is a source breaking change. It applies when code is compiled as C.

#### Example

```C
int f1(int);
int f2(char*);
int main(void)
{
return (f1 == f2);
}
// Old warning:
// C4028: formal parameter 1 different from declaration
// New warning:
// C4113: 'int (__cdecl *)(char *)' differs in parameter lists from 'int (__cdecl *)(int)'
```

### Error on a non-dependent static_assert

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.

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.

#### Example

In Visual Studio 2022 version 17.1 and later, this code now causes an error:

```cpp
template<typename T>
void f()
{
static_assert(false, "BOOM!");
}
```

To fix this issue, make the expression dependent. For example:

```cpp
template<typename>
constexpr bool dependent_false = false;

template<typename T>
void f()
{
static_assert(dependent_false<T>, "BOOM!");
}
```

With this change, the compiler only emits an error if the function template `f` is instantiated.

## <a name="improvements_170"></a> Conformance improvements in Visual Studio 2022 version 17.0

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

Expand Down
30 changes: 23 additions & 7 deletions docs/overview/what-s-new-for-visual-cpp-in-visual-studio.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,30 @@
---
title: "What's new for C++ in Visual Studio"
description: "The new features and fixes in the Microsoft C/C++ compiler and tools in Visual Studio."
ms.date: 11/05/2021
ms.date: 02/15/2022
ms.technology: "cpp-ide"
ms.custom: intro-whats-new
---
# What's new for C++ in Visual Studio 2022

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).

## What's new for C++ in Visual Studio version 17.1

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).

- 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.

- You can now debug core dumps on a remote macOS system from Visual Studio with LLDB or GDB.

- 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.

- 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.

- Added a new register visualization window for embedded targets, available through **Debug** > **Windows** > **Embedded Registers**.

- Added a new thread view for RTOS projects, available through **Debug** > **Windows** > **RTOS Objects**.

## What's new for C++ in Visual Studio version 17.0

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).
Expand Down Expand Up @@ -61,14 +77,14 @@ Select Standard Library (STL) improvements are highlighted here. For a comprehen
- [P1679R3](https://wg21.link/P1679R3) `contains()` For `basic_string` and `basic_string_view`
- [P1682R3](https://wg21.link/P1682R3) `to_underlying()` for enumerations
- [P2162R2](https://wg21.link/P2162R2) Allow inheriting from `std::variant`
- [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.
- [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.
- [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.
- [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.

**Highlighted performance improvements**

- `<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.
- Improved the performance of `std::find()` and `std::count()` for `vector<bool>` 19x and 26x (times, not percent).
- Improved the performance of `std::count()` for `vector<bool>`
- We improved the performance of `std::find()` and `std::count()` for `vector<bool>` 19x and 26x (times, not percent).
- We improved the performance of `std::count()` for `vector<bool>`
- `std::byte` now has the same performance as `unsigned char` in `reverse()` and `variant::swap()`

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

- 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**.

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

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

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

**C++ IntelliSense**

- [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).
- [`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).

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).

Expand Down
3 changes: 1 addition & 2 deletions docs/windows/attributes/attribute-programming-faq.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ metadata:
description: "Learn more about: Attribute programming FAQ"
title: "Attribute Programming FAQ"
ms.date: "10/02/2018"
ms.topic: "conceptual"
ms.topic: faq
helpviewer_keywords: ["attributed programming", "attributes [C++/CLI], frequently asked questions", "FAQs (frequently asked questions), attributed programming [C++]"]
ms.assetid: a1b8349f-7f51-43c4-95ea-4edb6e5f243f

title: Attribute programming FAQ
summary: |

Expand Down
Loading