Skip to content

Commit 95eee86

Browse files
author
Colin Robertson
authored
Merge pull request MicrosoftDocs#3310 from MicrosoftDocs/master637648189299061962
Repo sync for protected CLA branch
2 parents ac74fb4 + 730b4a7 commit 95eee86

File tree

75 files changed

+230
-221
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+230
-221
lines changed

docs/build/reference/c-cpp-prop-page.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -335,14 +335,15 @@ Enables OpenMP 2.0 language extensions. Sets [`/openmp`](openmp-enable-openmp-2-
335335

336336
### C++ Language Standard
337337

338-
Determines the C++ language standard the compiler enables. Use the latest version when possible. Sets [`/std:c++14`, `/std:c++17`, `/std:c++latest`](std-specify-language-standard-version.md).
338+
Determines the C++ language standard the compiler enables. The default value doesn't set a standard option, so the compiler uses its default C++14 setting. If you select a specific value, the corresponding [`/std`](std-specify-language-standard-version.md) compiler option is set.md).
339339

340340
#### Choices
341341

342-
- **Default**
343-
- **ISO C++14 Standard**
344-
- **ISO C++17 Standard**
345-
- **Preview - Features from the Latest C++ Working Draft**
342+
- **Default (ISO C++14 Standard)**
343+
- **ISO C++14 Standard (/std:c++14)**
344+
- **ISO C++17 Standard (/std:c++17)**
345+
- **ISO C++20 Standard (/std:c++20)**
346+
- **Preview - Features from the Latest C++ Working Draft (/std:c++latest)**
346347

347348
### Enable C++ Modules (experimental)
348349

docs/build/reference/experimental-module.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@ helpviewer_keywords: ["module", "/experimental:module", "Enable module support"]
77
---
88
# `/experimental:module` (Enable module support)
99

10-
Enables experimental compiler support for Standard Template Library named modules.
10+
Enables experimental compiler support for C++ Standard modules. This option is obsolete in Visual Studio version 16.11 and later.
1111

1212
## Syntax
1313

14-
> **/experimental:module**[**-**]
14+
> **`/experimental:module`**\[**`-`**]
1515
1616
## Remarks
1717

18-
You can enable experimental modules support by use of the **`/experimental:module`** compiler option along with the [/std:c++latest](std-specify-language-standard-version.md) option. Use **`/experimental:module-`** to disable module support explicitly.
18+
In versions of Visual Studio before Visual Studio 2019 version 16.11, you can enable experimental modules support by use of the **`/experimental:module`** compiler option along with the [`/std:c++latest`](std-specify-language-standard-version.md) option. In Visual Studio 2019 version 16.11, module support is enabled automatically by either **`/std:c++20`** or **`/std:c++latest`**. Use **`/experimental:module-`** to disable module support explicitly.
1919

20-
This option is available starting in Visual Studio 2015 Update 1. As of Visual Studio 2019 version 16.2, Draft C++20 Standard modules aren't fully implemented in the Microsoft C++ compiler. You can use the modules feature to create single-partition modules and to import the Standard Library modules provided by Microsoft. A module and the code that consumes it must be compiled with the same compiler options.
20+
This option is available starting in Visual Studio 2015 Update 1. As of Visual Studio 2019 version 16.2, C++20 Standard modules aren't fully implemented in the Microsoft C++ compiler. Modules support is feature complete in Visual Studio 2019 version 16.10. You can use the modules feature import the Standard Library modules provided by Microsoft. A module and the code that consumes it must be compiled with the same compiler options.
2121

2222
For more information on modules and how to use and create them, see [Overview of modules in C++](../../cpp/modules-cpp.md).
2323

docs/build/reference/general-property-page-project.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ To programmatically access this property, see <xref:Microsoft.VisualStudio.VCPro
113113

114114
### C++ Language Standard
115115

116-
Specifies which C++ language standard to use. The default is **`/std:c++14`**. Specify **`/std:c++17`** to use C++17 features, and **`/std:c++latest`** to use C++20 or other experimental features. For more information, see [`/std` (Specify language standard version)](std-specify-language-standard-version.md)
116+
Specifies which C++ language standard to use. The default is **`/std:c++14`**. Specify **`/std:c++17`** to use C++17 features, **`/std:c++20`** to use C++20 features, and **`/std:c++latest`** to use proposed C++23 features or other experimental features. For more information, see [`/std` (Specify language standard version)](std-specify-language-standard-version.md).
117117

118118
### C Language Standard
119119

docs/build/reference/headername.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ The name of a header file that the compiler should compile into a header unit (*
2323

2424
## Remarks
2525

26-
The **`/headerName`** compiler option is available starting in Visual Studio 2019 version 16.10 preview 2.
26+
The **`/headerName`** compiler option is available starting in Visual Studio 2019 version 16.10.
2727

28-
The **`/headerName`** compiler option, in all its forms, requires the [/std:c++latest](std-specify-language-standard-version.md) option.\
28+
The **`/headerName`** compiler option, in all its forms, requires the [`/std:c++20`](std-specify-language-standard-version.md) or later compiler option (such as **`/std:c++latest`**).\
2929
If you specify **`/headerName:{quote,angle}`**, you must also specify [`/exportHeader`](module-exportheader.md).
3030

3131
**`/headerName:quote`** looks up *`header-filename`* using the same rules as `#include "header-name"` and builds it as a header unit (*`.ifc`* file).\
@@ -39,14 +39,14 @@ Given a project that references a header file it defines called `m.h`, the compi
3939
cl /std:c++latest /exportHeader /headerName:quote m.h /Fom.h.obj
4040
```
4141

42-
The `/headerName:{quote,angle}`switch acts like a flag and does not explicitly need an argument. The following examples are valid:
42+
The `/headerName:{quote,angle}` option acts like a flag and does not explicitly need an argument. The following examples are valid:
4343

4444
```Bash
4545
cl /std:c++latest /exportHeader /headerName:angle /MP /Fo.\ vector iostream algorithm
4646
cl /std:c++latest /exportHeader /headerName:quote /MP /Fo.\ my-utilities.h a/b/my-core.h
4747
```
4848

49-
You can specify multiple `/headerName` switches on the same command line, and every argument after that switch will be processed with the specified *`header-filename`* lookup rules. The following example processes all the headers as the previous two command line examples in the same way. It looks up the headers using the lookup rules applied as if they had been specified as: `#include <vector>`, `#include "my-utilties.h"`, and `#include "a/b/my-core.h"`:
49+
You can specify multiple `/headerName` options on the same command line, and every argument after that option will be processed with the specified *`header-filename`* lookup rules. The following example processes all the headers as the previous two command line examples in the same way. It looks up the headers using the lookup rules applied as if they had been specified as: `#include <vector>`, `#include "my-utilties.h"`, and `#include "a/b/my-core.h"`:
5050

5151
```bash
5252
cl /std:c++latest /exportHeader /headerName:angle /MP /Fo.\ vector iostream algorithm /headerName:quote my-utilities.h a/b/my-core.h
@@ -55,7 +55,7 @@ cl /std:c++latest /exportHeader /headerName:angle /MP /Fo.\ vector iostream algo
5555
### To set this compiler option in the Visual Studio development environment
5656

5757
> [!NOTE]
58-
> Users don't typically set this command line switch. It is set by the build system.
58+
> Users don't typically set this command line option. It's set by the build system.
5959
6060
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).
6161

docs/build/reference/headerunit.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ The name of a file that contains compiled header unit information. To import mor
2727

2828
## Remarks
2929

30-
The **`/headerUnit`** compiler option requires the [/std:c++latest](std-specify-language-standard-version.md) option.
30+
The **`/headerUnit`** compiler option requires the [`/std:c++20`](std-specify-language-standard-version.md) or later compiler option (such as **`/std:c++latest`**).
3131

32-
The **`/headerUnit`** compiler option is available starting in Visual Studio 2019 version 16.10 preview 2.
32+
The **`/headerUnit`** compiler option is available starting in Visual Studio 2019 version 16.10.
3333

34-
When the compiler comes across `import "file";` or `import <file>;`, this compiler switch helps the compiler find the compiled header unit (*`.ifc`*) for the specified header file. The path to this file can be expressed in three ways:
34+
When the compiler comes across `import "file";` or `import <file>;`, this compiler option helps the compiler find the compiled header unit (*`.ifc`*) for the specified header file. The path to this file can be expressed in three ways:
3535

3636
**`/headerUnit`** looks up the compiled header unit in the current directory, or at the location specified in *`ifc-filename`*.
3737

@@ -41,7 +41,7 @@ When the compiler comes across `import "file";` or `import <file>;`, this compil
4141

4242
The compiler can't map a single *`header-name`* to multiple *`.ifc`* files. While mapping multiple *`header-name`* arguments to a single *`.ifc`* is possible, we don't recommend it. The contents of the *`.ifc`* get imported as if it was only the header specified by *`header-name`*.
4343

44-
The compiler implicitly enables the new preprocessor when this switch is used. That is, [`/Zc:preprocessor`](zc-preprocessor.md) is added to the command line by the compiler if any form of `/headerUnit` is specified on the command line. To opt out of the implicit `/Zc:preprocessor`, specify: `/Zc:preprocessor-`
44+
The compiler implicitly enables the new preprocessor when this option is used. That is, [`/Zc:preprocessor`](zc-preprocessor.md) is added to the command line by the compiler if any form of `/headerUnit` is specified on the command line. To opt out of the implicit `/Zc:preprocessor`, specify: `/Zc:preprocessor-`
4545

4646
If you disable the new preprocessor, but a file you compile imports a header unit, the compiler will report an error.
4747

docs/build/reference/module-exportheader.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ The argument to `/exportHeader` is a `/headerName` command-line option that spec
2323

2424
## Remarks
2525

26-
**`/exportHeader`** is available starting in Visual Studio 2019 version 16.10 Preview 2.
26+
**`/exportHeader`** is available starting in Visual Studio 2019 version 16.10.
2727

28-
The **`/exportHeader`** compiler option requires you enable the [`/std:c++latest`](std-specify-language-standard-version.md) option.
28+
The **`/exportHeader`** compiler option requires you enable the [`/std:c++20`](std-specify-language-standard-version.md) or later compiler option (such as **`/std:c++latest`**).
2929

3030
One **`/exportHeader`** compiler option can specify as many header-name arguments as your build requires. You don't need to specify them separately.
3131

32-
The compiler implicitly enables the new preprocessor when this switch is used. That is, [`/Zc:preprocessor`](zc-preprocessor.md) is added to the command line by the compiler if any form of `/exportHeader` is used on the command line. To opt out of the implicit `/Zc:preprocessor`, use: `/Zc:preprocessor-`
32+
The compiler implicitly enables the new preprocessor when this option is used. That is, [`/Zc:preprocessor`](zc-preprocessor.md) is added to the command line by the compiler if any form of `/exportHeader` is used on the command line. To opt out of the implicit `/Zc:preprocessor`, use: `/Zc:preprocessor-`
3333

3434
By default, the compiler doesn't produce an object file when a header unit is compiled. To produce an object file, specify the **`/Fo`** compiler option. For more information, see [`/Fo` (Object File Name)](fo-object-file-name.md).
3535

@@ -57,7 +57,7 @@ You normally shouldn't set this in the Visual Studio development environment. It
5757

5858
## See also
5959

60-
[`/headerName (Build a header unit from the specified header)`](headername.md) \
60+
[`/headerName (Build a header unit from the specified header)`](headername.md)\
6161
[`/headerUnit` (Use header unit IFC)](headerunit.md)\
6262
[`/reference` (Use named module IFC)](module-reference.md)\
6363
[`/translateInclude` (Translate include directives into import directives)](translateinclude.md)

docs/build/reference/module-reference.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ A valid name of an exported primary module interface unit name or full module pa
2626

2727
In most cases you won't need to specify this switch because the project system discovers module dependencies within a solution automatically.
2828

29-
The **`/reference`** compiler option requires you enable the [/std:c++latest](std-specify-language-standard-version.md) option. The **`/reference`** option is available starting in Visual Studio 2019 version 16.10 Preview 2.
29+
The **`/reference`** compiler option requires you enable the [`/std:c++20`](std-specify-language-standard-version.md) or later compiler option (such as **`/std:c++latest`**). The **`/reference`** option is available starting in Visual Studio 2019 version 16.10.
3030

3131
If the **`/reference`** argument is a *`filename`* without a *`module-name`*, the file gets opened at runtime to verify the *`filename`* argument names a specific import. It can result in slower runtime performance in scenarios that have many **`/reference`** arguments.
3232

docs/build/reference/permissive-standards-conformance.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ The **`/permissive-`** option is supported in Visual Studio 2017 and later. **`/
2121

2222
You can use the **`/permissive-`** compiler option to specify standards-conforming compiler behavior. This option disables permissive behaviors, and sets the [`/Zc`](zc-conformance.md) compiler options for strict conformance. In the IDE, this option also makes the IntelliSense engine underline non-conforming code.
2323

24-
The **`/permissive-`** option uses the conformance support in the current compiler version to determine which language constructs are non-conforming. The option doesn't determine if your code conforms to a specific version of the C++ standard. To enable all implemented compiler support for the latest draft standard, use the [`/std:c++latest`](std-specify-language-standard-version.md) option. To restrict the compiler support to the currently implemented C++17 standard, use the [`/std:c++17`](std-specify-language-standard-version.md) option. To restrict the compiler support to more closely match the C++14 standard, use the [`/std:c++14`](std-specify-language-standard-version.md) option, which is the default.
24+
The **`/permissive-`** option uses the conformance support in the current compiler version to determine which language constructs are non-conforming. The option doesn't determine if your code conforms to a specific version of the C++ standard. To enable all implemented compiler support for the latest draft standard, use the [`/std:c++latest`](std-specify-language-standard-version.md) option. To restrict the compiler support to the currently implemented C++20 standard, use the [`/std:c++20`](std-specify-language-standard-version.md) option. To restrict the compiler support to the currently implemented C++17 standard, use the [`/std:c++17`](std-specify-language-standard-version.md) option. To restrict the compiler support to more closely match the C++14 standard, use the [`/std:c++14`](std-specify-language-standard-version.md) option, which is the default.
2525

26-
Starting in Visual Studio 2019 version 16.8, the **`/std:c++latest`** option implicitly sets the **`/permissive-`** option. It's required for C++20 Modules support. Perhaps your code doesn't need modules support but requires other features enabled under **`/std:c++latest`**. You can explicitly enable Microsoft extension support by using the **`/permissive`** option without the trailing dash.
26+
The **`/permissive-`** option is implicitly set by the **`/std:c++latest`** option starting in Visual Studio 2019 version 16.8, and in version 16.11 by the **`/std:c++20`** option. **`/permissive-`** is required for C++20 Modules support. Perhaps your code doesn't need modules support but requires other features enabled under **`/std:c++20`** or **`/std:c++latest`**. You can explicitly enable Microsoft extension support by using the **`/permissive`** option without the trailing dash.
2727

2828
By default, the **`/permissive-`** option is set in new projects created by Visual Studio 2017 version 15.5 and later versions. It's not set by default in earlier versions. When the option is set, the compiler generates diagnostic errors or warnings when non-standard language constructs are detected in your code. These constructs include some common bugs in pre-C++11 code.
2929

@@ -261,7 +261,7 @@ auto y = cond ? 7 : int(a);
261261
auto z = cond ? A(7) : a;
262262
```
263263

264-
There's an important exception to this common pattern when T represents one of the null-terminated string types (for example, `const char *`, `const char16_t *`, and so on) and the actual argument to `?:` is a string literal of corresponding type. C++17 has changed semantics from C++14. As a result, the code in example 2 is accepted under **`/std:c++14`** and rejected under **`/std:c++17`** when **`/Zc:ternary`** or **`/permissive-`** is used.
264+
There's an important exception to this common pattern when T represents one of the null-terminated string types (for example, `const char *`, `const char16_t *`, and so on) and the actual argument to `?:` is a string literal of corresponding type. C++17 has changed semantics from C++14. As a result, the code in example 2 is accepted under **`/std:c++14`** and rejected under **`/std:c++17`** or later when **`/Zc:ternary`** or **`/permissive-`** is used.
265265

266266
```cpp
267267
// Example 2: exception from the above

docs/build/reference/sourcedependencies-directives.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ helpviewer_keywords: ["/sourceDependencies:directives compiler option", "/source
99
---
1010
# `/sourceDependencies:directives` (List module and header unit dependencies)
1111

12-
This command-line switch generates a JSON file that lists module and header-unit dependencies.
12+
This command-line option generates a JSON file that lists module and header-unit dependencies.
1313

1414
It identifies which modules and header units need to be compiled before the project that uses them is compiled. For instance, it will list `import <library>;` or `import "library";` as a header unit dependency, and `import name;` as a module dependency.
1515

1616
This command-line option is similar to [`/sourceDependencies`](sourcedependencies.md), but differs in the following ways:
1717

1818
- The compiler doesn't produce compiled output. Instead, the files are scanned for module directives. No compiled code, modules, or header units are produced.
19-
- The output JSON file doesn't list imported modules and imported header units (*`.ifc`* files) because this switch does a scan of the project files, not a compilation. So there are no built modules or header units to list.
19+
- The output JSON file doesn't list imported modules and imported header units (*`.ifc`* files) because this option does a scan of the project files, not a compilation. So there are no built modules or header units to list.
2020
- Only directly imported modules or header units are listed. It doesn't list the dependencies of the imported modules or header units themselves.
2121
- Header file dependencies are not listed. That is, `#include <file>` or `#include "file"` dependencies are not listed.
2222
- `/sourceDependencies:directives` is meant to be used before *`.ifc`* files are built.
@@ -40,7 +40,7 @@ If the argument is a directory, the compiler generates source dependency files i
4040

4141
## Remarks
4242

43-
**`/sourceDependencies:directives`** is available starting in Visual Studio 2019 version 16.10 Preview 2. It's not enabled by default.
43+
**`/sourceDependencies:directives`** is available starting in Visual Studio 2019 version 16.10. It's not enabled by default.
4444

4545
When you specify the **`/MP`** compiler option, we recommend you use **`/sourceDependencies`** with a directory argument. If you provide a single filename argument, two instances of the compiler may attempt to open the output file simultaneously and cause an error. For more information on **`/MP`**, see [`/MP` (Build with multiple processes)](mp-build-with-multiple-processes.md).
4646

0 commit comments

Comments
 (0)