Skip to content

Commit 77235bf

Browse files
authored
Merge pull request #3402 from MicrosoftDocs/master
2/9 AM Publish
2 parents 651f817 + fed6af5 commit 77235bf

5 files changed

+87
-34
lines changed

.whatsnew.json

+12-12
Original file line numberDiff line numberDiff line change
@@ -15,30 +15,30 @@
1515
"omitPullRequestTitles": false
1616
},
1717
"areas": [
18-
{"names": ["assembler", "intrinsics"], "heading": "Microsoft C/C++ compiler intrinsics and assembly language"},
18+
{"names": ["assembler", "intrinsics"], "heading": "C/C++ compiler intrinsics and assembly language"},
1919
{"names": ["atl", "atl-mfc-shared", "mfc"], "heading": "Active Template Library (ATL), Microsoft Foundation Classes (MFC)"},
20-
{"names": ["build"], "heading": "Microsoft C++ in Visual Studio projects and build systems"},
20+
{"names": ["build"], "heading": "C/C++ projects and build systems"},
2121
{"names": ["build-insights"], "heading": "Build insights"},
2222
{"names": ["c-language"], "heading": "C language"},
2323
{"names": ["cloud"], "heading": "Cloud programming with Microsoft C++"},
2424
{"names": ["code-quality"], "heading": "Code quality"},
25-
{"names": ["cpp"], "heading": "Microsoft C++ in Visual Studio"},
25+
{"names": ["cpp"], "heading": "C++ in Visual Studio"},
2626
{"names": ["cppcx"], "heading": "C++ /CX"},
2727
{"names": ["cross-platform"], "heading": "Cross platform development"},
2828
{"names": ["c-runtime-library"], "heading": "C runtime library"},
29-
{"names": ["data"], "heading": "Data access in Microsoft C/C++ in Visual Studio"},
29+
{"names": ["data"], "heading": "Data access in C/C++ in Visual Studio"},
3030
{"names": ["dotnet"], "heading":"STL/CLR library reference"},
31-
{"names": ["error-messages"], "heading":"Microsoft C/C++ compiler and tools errors and warnings"},
31+
{"names": ["error-messages"], "heading":"C/C++ compiler and tools errors and warnings"},
3232
{"names": ["extensions"], "heading":"Component extensions for .NET and UWP"},
33-
{"names": ["get-started"], "heading":"Microsoft C++ in Visual Studio tutorials"},
34-
{"names": ["ide"], "heading":"Read and write code using Microsoft C++ in Visual Studio"},
35-
{"names": ["linux"], "heading":"Linux with Microsoft C++ in Visual Studio"},
36-
{"names": ["overview"], "heading":"Microsoft C/C++ in Visual Studio overview"},
37-
{"names": ["parallel"], "heading":"Parallel programming in Microsoft C++ in Visual Studio"},
38-
{"names": ["porting"], "heading":"Microsoft C++ porting and upgrade guide"},
33+
{"names": ["get-started"], "heading":"C++ in Visual Studio tutorials"},
34+
{"names": ["ide"], "heading":"Read and write code using C++ in Visual Studio"},
35+
{"names": ["linux"], "heading":"Linux with C++ in Visual Studio"},
36+
{"names": ["overview"], "heading":"C/C++ in Visual Studio overview"},
37+
{"names": ["parallel"], "heading":"Parallel programming in C++ in Visual Studio"},
38+
{"names": ["porting"], "heading":"C++ porting and upgrade guide"},
3939
{"names": ["preprocessor"], "heading":"C/C++ preprocessor reference"},
4040
{"names": ["safeint", "security"], "heading":"Security best practices for C++"},
41-
{"names": ["standard-library"], "heading":"Microsoft C++ Standard Template Library (STL) reference"},
41+
{"names": ["standard-library"], "heading":"C++ Standard Template Library (STL) reference"},
4242
{"names": ["text"], "heading":"Text and strings in Visual Studio C++"},
4343
{"names": ["windows"], "heading":"Overview of Windows programming in C++"}
4444
]

docs/build/clang-support-msbuild.md

+53-10
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
description: "Learn more about: Clang/LLVM support in Visual Studio projects"
3-
title: "Clang/LLVM support in Visual Studio Visual Studio projects"
4-
ms.date: "06/02/2020"
3+
title: "Clang/LLVM support in Visual Studio projects"
4+
ms.date: 02/05/2021
55
ms.description: "Configure a Visual Studio MSBuild project to use the Clang/LLVM toolchain."
66
helpviewer_keywords: ["Clang support for C++ MSBuild projects"]
77
---
@@ -19,7 +19,9 @@ You can use Visual Studio 2019 version 16.2 with Clang to edit, build, and debug
1919

2020
## Install
2121

22-
For best IDE support in Visual Studio, we recommend using the latest Clang compiler tools for Windows. If you don't already have those, you can install them by opening the Visual Studio Installer and choosing **C++ Clang tools for Windows** under **Desktop development with C++** optional components. If you prefer to use an existing Clang installation on your machine, choose the **C++ Clang-cl for v142 build tools.** optional component. The Microsoft C++ Standard Library currently requires at least Clang 8.0.0; the bundled version of Clang will automatically be updated to stay current with updates in the Microsoft implementation of the Standard Library.
22+
For best IDE support in Visual Studio, we recommend using the latest Clang compiler tools for Windows. If you don't already have the tools, you can install them by opening the Visual Studio Installer and choosing **C++ Clang tools for Windows** under **Desktop development with C++** optional components. You may prefer to use an existing Clang installation on your machine; if so, choose the **C++ Clang-cl for v142 build tools.** optional component.
23+
24+
The Microsoft C++ Standard Library currently requires at least Clang 8.0.0. The bundled version of Clang gets updated automatically to stay current with updates in the Microsoft implementation of the Standard Library.
2325

2426
![Screenshot of the Visual Studio installer with the Individual components tab selected and the C plus plus Clang components visible.](media/clang-install-vs2019.png)
2527

@@ -29,9 +31,9 @@ To configure a Visual Studio project to use Clang, right-click on the project no
2931

3032
![Screenshot of the Property Pages dialog box with Configuration Properties > General selected and the Platform Toolset and L L V M (clang c l) options highlighted.](media/clang-msbuild-prop-page.png)
3133

32-
If you are using the Clang tools that are bundled with Visual Studio, no additional steps are required. For Windows projects, Visual Studio by default invokes Clang in [clang-cl](https://llvm.org/devmtg/2014-04/PDFs/Talks/clang-cl.pdf) mode and links with the Microsoft implementation of the Standard Library. By default, **clang-cl.exe** is located in *%VCINSTALLDIR%\\Tools\\Llvm\\bin\\* and *%VCINSTALLDIR%\\Tools\\Llvm\\x64\\bin\\*.
34+
If you're using the Clang tools that are bundled with Visual Studio, no extra steps are required. For Windows projects, Visual Studio by default invokes Clang in [clang-cl](https://llvm.org/devmtg/2014-04/PDFs/Talks/clang-cl.pdf) mode. It links with the Microsoft implementation of the Standard Library. By default, **clang-cl.exe** is located in *%VCINSTALLDIR%\\Tools\\Llvm\\bin\\* and *%VCINSTALLDIR%\\Tools\\Llvm\\x64\\bin\\*.
3335

34-
If you are using a custom Clang installation, you can either modify **Project** > **Properties** > **VC++ DIrectories** > **Configuration Properties** > **Executable Directories** by adding the custom Clang installation root as the first directory there, or change the value of the `LLVMInstallDir` property. See [Set a custom LLVM location](#custom_llvm_location) for more information.
36+
If you're using a custom Clang installation, you can either modify **Project** > **Properties** > **VC++ DIrectories** > **Configuration Properties** > **Executable Directories** by adding the custom Clang installation root as the first directory there, or change the value of the `LLVMInstallDir` property. For more information, see [Set a custom LLVM location](#custom_llvm_location).
3537

3638
## Configure a Linux project to use Clang tools
3739

@@ -41,28 +43,69 @@ To configure a Visual Studio Linux project to use Clang:
4143

4244
1. Right-click on the project node in **Solution Explorer** and choose **Properties**.
4345
1. Typically, you should first choose **All configurations** at the top of the dialog.
44-
1. Under **General** > **Platform Toolset**, choose **WSL_Clang_1_0** if you are using Windows Subsystem for Linux, or **Remote_Clang_1_0** if you are using a remote machine or VM.
46+
1. Under **General** > **Platform Toolset**, choose **WSL_Clang_1_0** if you're using Windows Subsystem for Linux (WSL). Choose **Remote_Clang_1_0** if you're using a remote machine or VM.
4547
1. Press **OK**.
4648

4749
![Screenshot of the Console App clang Visual Studio 2019 Property Pages dialog box with Configuration Properties > General selected and the Platform Toolset and L L V M (clang c l) options highlighted.](media/clang-msbuild-prop-page.png)
4850

49-
On Linux, Visual Studio by default uses the first Clang location that it encounters in the PATH environment property. If you are using a custom Clang installation, then you must change the value of the `LLVMInstallDir` property or else substitute a path under **Project** > **Properties** > **VC++ DIrectories** > **Configuration Properties** > **Executable Directories**. See [Set a custom LLVM location](#custom_llvm_location) for more information.
51+
On Linux, Visual Studio by default uses the first Clang location that it finds in the PATH environment property. If you're using a custom Clang installation, then either change the value of the `LLVMInstallDir` property or else enter the path under **Project** > **Properties** > **Configuration Properties** > **VC++ DIrectories** > **Executable Directories**. For more information, see [Set a custom LLVM location](#custom_llvm_location).
5052

5153
## <a name="custom_llvm_location"></a> Set a custom LLVM location
5254

53-
You can set a custom path for LLVM for one or more projects by creating a *Directory.build.props* file and adding that file to the root folder of any project. You can add it to the root solution folder to apply it to all projects in the solution. The file should look like this (but substitute your actual path):
55+
You can set a custom path to LLVM for one or more projects by creating a *Directory.build.props* file. Then, add that file to the root folder of any project. You can add it to the root solution folder to apply it to all projects in the solution. The file should look like this (but use your actual LLVM path):
5456

5557
```xml
5658
<Project>
5759
<PropertyGroup>
58-
<LLVMInstallDir>c:\MyLLVMRootDir</LLVMInstallDir>
60+
<LLVMInstallDir>C:\MyLLVMRootDir</LLVMInstallDir>
5961
</PropertyGroup>
6062
</Project>
6163
```
6264

65+
You can combine this property with a custom LLVM toolset version. For more information, see [Set a custom LLVM toolset version](#custom_llvm_toolset).
66+
67+
## <a name="custom_llvm_toolset"></a> Set a custom LLVM toolset version
68+
69+
Starting in Visual Studio 2019 version 16.9, you can set a custom toolset version for LLVM. To set this property in a project in Visual Studio:
70+
71+
1. Open the project's **Property Pages** dialog box. For details, see [Set C++ compiler and build properties in Visual Studio](./working-with-project-properties.md).
72+
73+
1. Select the **Configuration Properties** > **General** property page.
74+
75+
1. Modify the **Platform Toolset** property to *LLVM (clang-cl)*, if it isn't already set.
76+
77+
1. Select the **Configuration Properties** > **Advanced** property page.
78+
79+
1. Modify the **LLVM Toolset Version** property to your preferred version, and then choose **OK** to save your changes.
80+
81+
The **LLVM Toolset Version** property only appears when the LLVM platform toolset is selected.
82+
83+
You can set the toolset version for one or more projects by creating a *Directory.build.props* file. Then, add that file to the root folder of any project. Add it to the root solution folder to apply it to all projects in the solution. The file should look like this (but use your actual LLVM path):
84+
85+
```xml
86+
<Project>
87+
<PropertyGroup>
88+
<LLVMToolsVersion>11.0.0</LLVMToolsVersion>
89+
</PropertyGroup>
90+
</Project>
91+
```
92+
93+
You can also combine this property with a custom LLVM location. For example, your *Directory.build.props* file could look like:
94+
95+
```xml
96+
<Project>
97+
<PropertyGroup>
98+
<LLVMInstallDir>C:\MyLLVMRootDir</LLVMInstallDir>
99+
<LLVMToolsVersion>11.0.0</LLVMToolsVersion>
100+
</PropertyGroup>
101+
</Project>
102+
```
103+
104+
When you add a *Directory.build.props* file, the settings appear as the default in the project Property Pages dialog. However, changes to these properties in Visual Studio override the settings in the *Directory.build.props* file.
105+
63106
## Set additional properties, edit, build, and debug
64107

65-
After you have set up a Clang configuration, right-click again on the project node and choose **Reload project**. You can now build and debug the project using the Clang tools. Visual Studio detects that you are using the Clang compiler and provides IntelliSense, highlighting, navigation, and other editing features. Errors and warnings are displayed in the **Output Window**. The project property pages for a Clang configuration are very similar to those for MSVC, although some compiler-dependent features such as Edit and Continue are not available for Clang configurations. To set a Clang compiler or linker option that is not available in the property pages, you can add it manually in the property pages under **Configuration Properties** > **C/C++ (or Linker)** > **Command Line** > **Additional Options**.
108+
After you have set up a Clang configuration, right-click again on the project node and choose **Reload project**. You can now build and debug the project using the Clang tools. Visual Studio detects that you're using the Clang compiler and provides IntelliSense, highlighting, navigation, and other editing features. Errors and warnings are displayed in the **Output Window**. The project property pages for a Clang configuration are similar to the ones for MSVC. However, some compiler-dependent features such as Edit and Continue aren't available for Clang configurations. You can set a Clang compiler or linker option that isn't available in the property pages. Add it manually in the property pages under **Configuration Properties** > **C/C++ (or Linker)** > **Command Line** > **Additional Options**.
66109

67110
When debugging, you can use breakpoints, memory and data visualization, and most other debugging features.
68111

docs/build/reference/advanced-property-page.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
22
description: "Learn more about: Advanced Property Page"
33
title: "Advanced Property Page (Project)"
4-
ms.date: 08/10/2020
5-
f1_keywords: ["VC.Project.VCConfiguration.VCToolsVersion"]
4+
ms.date: 02/05/2021
5+
f1_keywords: ["VC.Project.VCConfiguration.VCToolsVersion","VC.Project.VCConfiguration.LLVMToolsVersion"]
66
ms.description: "Use the Advanced property page in Visual Studio 2019 to set various properties for C++ projects."
77
---
88
# Advanced Property Page
@@ -83,6 +83,10 @@ The Advanced property page is available in Visual Studio 2019 and later.
8383

8484
Specifies the full version of the MSVC toolset that's used to build the project. You may have various update and preview versions of a toolset installed. You can specify which one to use here.
8585

86+
- **LLVM Toolset Version**
87+
88+
Specifies the full version of the LLVM toolset that's used to build the project. This property is available when **LLVM (clang-cl)** is selected as the platform toolset, starting in Visual Studio 2019 version 16.9. For more information, see [Set a custom LLVM toolset version](..\clang-support-msbuild.md#custom_llvm_toolset).
89+
8690
## C++/CLI Properties
8791

8892
- **Common Language Runtime support**

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

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
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: "05/19/2020"
4+
ms.date: "02/08/2021"
55
ms.technology: "cpp-ide"
6-
ms.assetid: 8801dbdb-ca0b-491f-9e33-01618bff5ae9
76
---
87
# What's new for C++ in Visual Studio
98

109
::: moniker range=">=msvc-160"
1110

1211
Visual Studio 2019 brings many updates and fixes to the Microsoft C++ environment. We've fixed many bugs and issues in the compiler and tools. Many of these issues were submitted by customers through the [Report a Problem](/visualstudio/ide/how-to-report-a-problem-with-visual-studio?view=vs-2019&preserve-view=true) and [Provide a Suggestion](https://aka.ms/feedback/suggest?space=62) options under **Send Feedback**. Thank you for reporting bugs! For more information on what's new in all of Visual Studio, visit [What's new in Visual Studio 2019](/visualstudio/ide/whats-new-visual-studio-2019). For information on what's new for C++ in Visual Studio 2017, see [What's new for C++ in Visual Studio 2017](?preserve-view=true&view=msvc-150). For information on what's new for C++ in Visual Studio 2015 and earlier versions, see [Visual C++ What's New 2003 through 2015](../porting/visual-cpp-what-s-new-2003-through-2015.md).
1312

13+
For information about what's new in the C++ docs, see [Microsoft C++ docs: What's new](whats-new-cpp-docs.md).
14+
1415
## C++ compiler
1516

1617
- Enhanced support for C++17 features and correctness fixes, plus experimental support for C++20 features such as modules and coroutines. For detailed information, see [C++ Conformance Improvements in Visual Studio 2019](cpp-conformance-improvements.md).

docs/overview/whats-new-cpp-docs.md

+13-8
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
---
22
title: "What's new for the C++ docs"
33
description: "The new docs and doc updates for the Microsoft C/C++ compiler, ATL/MFC, C runtime, and standard library docs."
4-
ms.date: "02/05/2021"
4+
ms.date: "02/08/2021"
55
---
66
# Microsoft C++ docs: What's new for Visual Studio 16.8
77

8-
This article lists some of the major changes to docs for Visual Studio 16.8.
8+
This article lists some of the major changes to docs for Visual Studio 16.8.
9+
10+
For information about what's new in Visual Studio, see [What's new for C++ in Visual Studio](what-s-new-for-visual-cpp-in-visual-studio.md).
11+
12+
For the latest C++ conformance status, see [C++ conformance improvements in Visual Studio](cpp-conformance-improvements.md)
913

1014
## C language
1115

@@ -107,7 +111,7 @@ This article lists some of the major changes to docs for Visual Studio 16.8.
107111
- [Configure a Linux CMake project in Visual Studio](../linux/cmake-linux-configure.md) - Updated to reflect latest UI
108112
- [Deploy, run, and debug your Linux MSBuild project](../linux/deploy-run-and-debug-your-linux-project.md) - Added `GDB Path`
109113

110-
## Microsoft C/C++ compiler and tools errors and warnings
114+
## C/C++ compiler and tools errors and warnings
111115

112116
### New articles
113117

@@ -121,7 +125,7 @@ This article lists some of the major changes to docs for Visual Studio 16.8.
121125
- [Compiler warnings C4800 through C5999](../error-messages/compiler-warnings/compiler-warnings-c4800-through-c4999.md) - Updated 16.7 warnings
122126
- [Compiler Error C3381](../error-messages/compiler-errors-2/compiler-error-c3381.md) - Address cpp-docs 2493; update remarks and example
123127

124-
## Microsoft C/C++ compiler intrinsics and assembly language
128+
## C/C++ compiler intrinsics and assembly language
125129

126130
### Updated articles
127131

@@ -130,15 +134,15 @@ This article lists some of the major changes to docs for Visual Studio 16.8.
130134
- [C++ in Visual Studio](../overview/visual-cpp-in-visual-studio.md) - Updated DevCom and Microsoft Docs Q&A links
131135
- [Microsoft C++ language conformance table](../overview/visual-cpp-language-conformance.md) - Updated C++20 library conformance table, update language feature table for 16.7
132136

133-
## Microsoft C++ in Visual Studio
137+
## C++ in Visual Studio
134138

135139
### Updated articles
136140

137141
- [`__restrict`](../cpp/extension-restrict.md)
138142
- [if-else statement (C++)](../cpp/if-else-statement-cpp.md) - Added description for `if/else` grammar
139143
- [`union`](../cpp/unions.md) - Fixed code snippet
140144

141-
## Microsoft C++ in Visual Studio projects and build systems
145+
## C/C++ projects and build systems
142146

143147
### New articles
144148

@@ -155,13 +159,14 @@ This article lists some of the major changes to docs for Visual Studio 16.8.
155159
- [`/clr` (Common Language Runtime Compilation)](../build/reference/clr-common-language-runtime-compilation.md) - Added description for `/clr`
156160
- [pgosweep](../build/pgosweep.md) - Added more pgosweep options
157161
- [Importing data using `__declspec(dllimport)`](../build/importing-data-using-declspec-dllimport.md) - Updated example
158-
## Microsoft C++ porting and upgrade guide
162+
163+
## C++ porting and upgrade guide
159164

160165
### Updated articles
161166

162167
- [How to: Use existing C++ code in a Universal Windows Platform app](../porting/how-to-use-existing-cpp-code-in-a-universal-windows-platform-app.md) - Reworked for clarity and updated examples
163168

164-
## Microsoft C++ Standard Library (STL) reference
169+
## C++ Standard Library (STL) reference
165170

166171
### New articles
167172

0 commit comments

Comments
 (0)