Skip to content

Commit d19ee24

Browse files
Merge pull request #4972 from MicrosoftDocs/main638451754507472643sync_temp
For protected branch, push strategy should use PR and merge to target branch method to work around git push error
2 parents 59be1de + eb11bb9 commit d19ee24

File tree

3 files changed

+15
-20
lines changed

3 files changed

+15
-20
lines changed

docs/code-quality/clang-tidy.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
---
22
title: Using Clang-Tidy in Visual Studio
33
description: "How to use Clang-Tidy in Visual Studio for Microsoft C++ code analysis."
4-
ms.date: 02/22/2022
4+
ms.date: 03/1/2022
55
ms.topic: "conceptual"
66
f1_keywords: ["vs.codeanalysis.clangtidy"]
77
---
88
# Using Clang-Tidy in Visual Studio
99

1010
::: moniker range="<=msvc-150"
1111

12-
Support for Clang-Tidy requires Visual Studio 2019 version 16.4 or later. To see the documentation for this version, set the Visual Studio **Version** selector control for this article to Visual Studio 2019 or later. It's found at the top of the table of contents on this page.
12+
Support for Clang-Tidy requires Visual Studio 2019 version 16.4 or later. To see the documentation for this version, set the Visual Studio **Version** selector control for this article to Visual Studio 2019 or later. It's at the top of the table of contents on this page.
1313

1414
::: moniker-end
1515

@@ -37,13 +37,13 @@ Clang-Tidy recognizes the following keys:
3737

3838
- `enableMicrosoftCodeAnalysis`: Enables Microsoft Code Analysis
3939
- `enableClangTidyCodeAnalysis`: Enables Clang-Tidy analysis
40-
- `clangTidyChecks`: Clang-Tidy configuration. A comma-separated list of checks to enable or disable. A leading `-` disables the check. For example, "cert-oop58-cpp, -cppcoreguidelines-no-malloc, google-runtime-int" enables `cert-oop58-cpp` and `google-runtime-int`, but disables `cppcoreguidelines-no-malloc`.
40+
- `clangTidyChecks`: Clang-Tidy configuration. A comma-separated list of checks to enable or disable. A leading `-` disables the check. For example, `cert-oop58-cpp, -cppcoreguidelines-no-malloc, google-runtime-int` enables `cert-oop58-cpp` and `google-runtime-int`, but disables `cppcoreguidelines-no-malloc`. For a list of Clang-Tidy checks, see the [Clang-Tidy documentation](https://clang.llvm.org/extra/clang-tidy/checks/list.html).
4141

42-
If neither of the "enable" options are specified, Visual Studio will select the analysis tool matching the Platform Toolset used.
42+
If neither of the "enable" options are specified, Visual Studio selects the analysis tool matching the Platform Toolset used.
4343

4444
### CMake settings
4545

46-
To edit your Clang-Tidy settings, open your CMake settings, and select **Edit JSON** in the CMake Project Settings Editor. You can use the keys above to fill out your Clang-Tidy specifications in the CMake Settings json file.
46+
To edit your Clang-Tidy settings, open your CMake settings, and select **Edit JSON** in the CMake Project Settings Editor. You can use the keys above to fill out your Clang-Tidy specifications in the CMake Settings JSON file.
4747

4848
An example CMake settings implementation looks like this:
4949

@@ -82,18 +82,17 @@ An example CMake preset implementation looks like this:
8282
}
8383
]
8484
```
85-
8685
## Warning display
8786

88-
Clang-Tidy runs result in warnings displayed in the Error List, and as in-editor squiggles underneath relevant sections of code. Use the "Category" column in the Error List to sort and organize Clang-Tidy warnings. You can configure in-editor warnings by toggling the "Disable Code Analysis Squiggles" setting under **Tools** > **Options**.
87+
Clang-Tidy runs result in warnings displayed in the Error List, and as in-editor squiggles underneath relevant sections of code. To sort and organize Clang-Tidy warnings, use the **Category** column in the **Error List** window. You can configure in-editor warnings by toggling the **Disable Code Analysis Squiggles** setting under **Tools** > **Options**.
8988

9089
## Clang-Tidy configuration
9190

9291
By default, Clang-Tidy does not set any checks when enabled. To see the list of checks in the command-line version, run `clang-tidy -list-checks` in a developer command prompt. You can configure the checks that Clang-Tidy runs inside Visual Studio. In the project Property Pages dialog, open the **Configuration Properties** > **Code Analysis** > **Clang-Tidy** page. Enter checks to run in the **Clang-Tidy Checks** property. A good default set is `clang-analyzer-*`. This property value is provided to the **`--checks`** argument of the tool. Any further configuration can be included in custom *`.clang-tidy`* files. For more information, see the [Clang-Tidy documentation on LLVM.org](https://clang.llvm.org/extra/clang-tidy/).
9392

9493
## See also
9594

96-
- [Clang/LLVM support for MSBuild projects](https://devblogs.microsoft.com/cppblog/clang-llvm-support-for-msbuild-projects/)
97-
- [Clang/LLVM support for CMake projects](https://devblogs.microsoft.com/cppblog/visual-studio-cmake-support-clang-llvm-cmake-3-14-vcpkg-and-performance-improvements/)
95+
[Clang/LLVM support for MSBuild projects](https://devblogs.microsoft.com/cppblog/clang-llvm-support-for-msbuild-projects/)\
96+
[Clang/LLVM support for CMake projects](https://devblogs.microsoft.com/cppblog/visual-studio-cmake-support-clang-llvm-cmake-3-14-vcpkg-and-performance-improvements/)
9897

9998
::: moniker-end

docs/cpp/examples-of-lambda-expressions.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ description: "Learn more about: Examples of Lambda Expressions"
33
title: "Examples of Lambda Expressions"
44
ms.date: "05/07/2019"
55
helpviewer_keywords: ["lambda expressions [C++], examples"]
6-
ms.assetid: 52506b15-0771-4190-a966-2f302049ca86
76
---
87
# Examples of Lambda Expressions
98

@@ -52,7 +51,7 @@ Although lambda expressions are most often declared in the body of a function, y
5251

5352
### Example 2
5453

55-
The Microsoft C++ compiler binds a lambda expression to its captured variables when the expression is declared instead of when the expression is called. The following example shows a lambda expression that captures the local variable `i` by value and the local variable `j` by reference. Because the lambda expression captures `i` by value, the reassignment of `i` later in the program does not affect the result of the expression. However, because the lambda expression captures `j` by reference, the reassignment of `j` does affect the result of the expression.
54+
The Microsoft C++ compiler binds a lambda expression to its captured variables when the expression is declared instead of when the expression is called. The following example shows a lambda expression that captures the local variable `i` by value and the local variable `j` by reference. Because the lambda expression captures `i` by value, the reassignment of `i` later in the program doesn't affect the result of the expression. However, because the lambda expression captures `j` by reference, the reassignment of `j` does affect the result of the expression.
5655

5756
```cpp
5857
// declaring_lambda_expressions2.cpp
@@ -319,7 +318,7 @@ int main()
319318
values.push_back(4);
320319

321320
// Create a Scale object that scales elements by 3 and apply
322-
// it to the vector object. Does not modify the vector.
321+
// it to the vector object. doesn't modify the vector.
323322
Scale s(3);
324323
s.ApplyScale(values);
325324
}
@@ -424,7 +423,7 @@ int main()
424423
// Create another vector that contains index values.
425424
vector<int> indices(3);
426425
indices[0] = 0;
427-
indices[1] = -1; // This is not a valid subscript. It will trigger an exception.
426+
indices[-1] = 1; // This is not a valid subscript. It will trigger an exception.
428427
indices[2] = 2;
429428

430429
// Use the values from the vector of index values to
@@ -460,7 +459,7 @@ For more information about exception handling, see [Exception Handling](../cpp/e
460459

461460
### Example
462461

463-
The capture clause of a lambda expression cannot contain a variable that has a managed type. However, you can pass an argument that has a managed type to the parameter list of a lambda expression. The following example contains a lambda expression that captures the local unmanaged variable `ch` by value and takes a <xref:System.String?displayProperty=fullName> object as its parameter.
462+
The capture clause of a lambda expression can't contain a variable that has a managed type. However, you can pass an argument that has a managed type to the parameter list of a lambda expression. The following example contains a lambda expression that captures the local unmanaged variable `ch` by value and takes a <xref:System.String?displayProperty=fullName> object as its parameter.
464463

465464
```cpp
466465
// managed_lambda_expression.cpp

docs/windows/clickonce-deployment-for-visual-cpp-applications.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,25 @@ description: "Learn more about: ClickOnce Deployment for Visual C++ Applications
33
title: "ClickOnce Deployment for Visual C++ Applications"
44
ms.date: "11/04/2016"
55
helpviewer_keywords: ["deploying applications [C++], ClickOnce", "application deployment [C++], ClickOnce", "ClickOnce deployment [C++], C++ applications"]
6-
ms.assetid: 9988c546-0936-452c-932f-9c76daa42157
76
---
87
# ClickOnce Deployment for Visual C++ Applications
98

109
Visual Studio provides two different technologies for deploying Windows applications: ClickOnce deployment or [Windows Installer](/windows/win32/Msi/windows-installer-portal) deployment.
1110

1211
## ClickOnce Deployment in C++
1312

14-
The Visual C++ development environment does not directly support deployment of Visual Studio C++ projects with ClickOnce, but tools are available to use it.
15-
1613
> [!NOTE]
17-
> Visual Studio does support ClickOnce in the Visual C# and Visual Basic development environments. If your Visual Studio C++ project is a dependency of a Visual C# project, you can publish the application (including its dependencies) using ClickOnce deployment from the Visual C# development environment.
14+
> ClickOnce does not support deployment of native C++ applications. However, you can use ClickOnce to deploy a Visual C++ application if it is a dependency of a Visual C# or VB.NET project. For example, if you have a Visual C# project that depends on a Visual C++ project, you can publish the application (including its dependencies) using ClickOnce deployment from the Visual C# development environment. If you have a Visual Basic .NET project that depends on a Visual C++ project, you can publish the application (including its dependencies) using ClickOnce deployment from the Visual Basic .NET development environment.
1815
1916
To deploy a Visual C++ application using ClickOnce, you first have to build a [ClickOnce Application Manifest](/visualstudio/deployment/clickonce-application-manifest) and a [ClickOnce Deployment Manifest](/visualstudio/deployment/clickonce-deployment-manifest) using the [Mage.exe (Manifest Generation and Editing Tool)](/dotnet/framework/tools/mage-exe-manifest-generation-and-editing-tool) or its graphical user interface version (for information, see [MageUI.exe (Manifest Generation and Editing Tool, Graphical Client)](/dotnet/framework/tools/mageui-exe-manifest-generation-and-editing-tool-graphical-client)).
2017

21-
You first use Mage.exe to build the application manifest; the resulting file will have the extension .manifest. You then use Mage.exe to build the deployment manifest; the resulting file will have the extension .application. You then sign the manifests.
18+
You first use Mage.exe to build the application manifest; the resulting file will have the extension .manifest. You then use Mage.exe to build the deployment manifest; the resulting file will have the extension `.application`. You then sign the manifests.
2219

2320
The application manifest must specify the target processor (**x86**, **x64**, or **ARM**). See [Deploying Prerequisites for 64-bit Applications](/visualstudio/deployment/deploying-prerequisites-for-64-bit-applications) for information on these options.
2421

2522
Also, the name of the application and deployment manifests must be different from the name of the C++ application. This avoids conflict between the application manifest created by Mage.exe and the external manifest that is part of the C++ application.
2623

27-
Your deployment will need to install any Visual C++ libraries on which your application depends. To determine the dependencies for a particular application, you can use depends.exe or the DUMPBIN utility with the /DEPENDENTS option. For more information on dependencies, see [Understanding the Dependencies of a Visual C++ Application](understanding-the-dependencies-of-a-visual-cpp-application.md). You might need to run VCRedist.exe; this utility installs Visual C++ libraries on the target computer.
24+
Your deployment needs to install any Visual C++ libraries on which your application depends. To determine the dependencies for a particular application, you can use depends.exe or the `DUMPBIN` utility with the `/DEPENDENTS` option. For more information on dependencies, see [Understanding the Dependencies of a Visual C++ Application](understanding-the-dependencies-of-a-visual-cpp-application.md). You might need to run VCRedist.exe; this utility installs Visual C++ libraries on the target computer.
2825

2926
You may also need to build a bootstrapper (prerequisites installer) for your application to deploy prerequisite components; for information on the bootstrapper, see [Creating Bootstrapper Packages](/visualstudio/deployment/creating-bootstrapper-packages).
3027

0 commit comments

Comments
 (0)