You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This option enables an experimental, token-based preprocessor that more closely conforms to C++11 standards, including C99 preprocessor features. For more information, see [MSVC experimental preprocessor overview](../../preprocessor/preprocessor-experimental-overview.md).
10
+
This option is obsolete starting in Visual Studio 2019 version 16.5, replaced by the [`/Zc:preprocessor`](zc-preprocessor.md) compiler option. **`/experimental:preprocessor`**enables an experimental, token-based preprocessor that more closely conforms to C++11 standards, including C99 preprocessor features. For more information, see [MSVC new preprocessor overview](../../preprocessor/preprocessor-experimental-overview.md).
11
11
12
12
## Syntax
13
13
14
-
> **/experimental:preprocessor**[**-**]
14
+
> **`/experimental:preprocessor`**\[**`-`**]
15
15
16
16
## Remarks
17
17
18
-
Use the **/experimental:preprocessor** compiler option to enable the experimental conforming preprocessor. You can use **/experimental:preprocessor-** option to explicitly specify the traditional preprocessor.
18
+
Use the **`/experimental:preprocessor`** compiler option to enable the experimental conforming preprocessor. You can use **`/experimental:preprocessor-`** option to explicitly specify the traditional preprocessor.
19
19
20
-
The **/experimental:preprocessor** option is available starting in Visual Studio 2017 version 15.8.
20
+
The **`/experimental:preprocessor`** option is available starting in Visual Studio 2017 version 15.8. Starting in Visual Studio 2019 version 16.5, the new preprocessor is complete, and available under the [`/Zc:preprocessor`](zc-preprocessor.md) compiler option.
21
21
22
22
### To set this compiler option in the Visual Studio development environment
23
23
24
24
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).
Copy file name to clipboardExpand all lines: docs/build/reference/zc-conformance.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,6 +28,7 @@ These are the **`/Zc`** compiler options:
28
28
|[`/ZcimplicitNoexcept`](zc-implicitnoexcept-implicit-exception-specifiers.md)| Enable implicit **`noexcept`** on required functions (on by default). |
29
29
|[`/Zc:inline`](zc-inline-remove-unreferenced-comdat.md)| Remove unreferenced function or data if it is COMDAT or has internal linkage only (off by default). |
30
30
|[`/Zc:noexceptTypes`](zc-noexcepttypes.md)| Enforce C++17 **`noexcept`** rules (on by default in C++17 or later). |
31
+
|[`/Zc:preprocessor`](zc-preprocessor.md)| Use the new conforming preprocessor (off by default, except in C11/C17). |
31
32
|[`/Zc:referenceBinding`](zc-referencebinding-enforce-reference-binding-rules.md)| A UDT temporary will not bind to an non-const lvalue reference (off by default). |
32
33
|[`/Zc:rvalueCast`](zc-rvaluecast-enforce-type-conversion-rules.md)| Enforce Standard C++ explicit type conversion rules (off by default). |
33
34
|[`/Zc:sizedDealloc`](zc-sizeddealloc-enable-global-sized-dealloc-functions.md)| Enable C++14 global sized deallocation functions (on by default). |
This option enables a token-based preprocessor that conforms to C99 and C++11 and later standards. For more information, see [MSVC new preprocessor overview](../../preprocessor/preprocessor-experimental-overview.md).
11
+
12
+
## Syntax
13
+
14
+
> **`/Zc:preprocessor`**[**-**]
15
+
16
+
## Remarks
17
+
18
+
Use the **`/Zc:preprocessor`** compiler option to enable the conforming preprocessor. You can use **`/Zc:preprocessor-`** option to explicitly specify the traditional (non-conforming) preprocessor.
19
+
20
+
The **`/Zc:preprocessor`** option is available starting in Visual Studio 2019 version 16.5. An earlier, incomplete version of the new preprocessor option is available in versions of Visual Studio starting in Visual Studio 2017 version 15.8. For more information, see [`/experimental:preprocessor`](experimental-preprocessor.md).
21
+
22
+
### To set this compiler option in the Visual Studio development environment
23
+
24
+
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).
Copy file name to clipboardExpand all lines: docs/porting/visual-cpp-porting-and-upgrading-guide.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
title: "Microsoft C++ porting and upgrading guide"
3
3
description: "Upgrade Microsoft C++ code to the latest version of Visual Studio."
4
-
ms.date: "11/18/2019"
4
+
ms.date: 09/10/2020
5
5
ms.assetid: f5fbcc3d-aa72-41a6-ad9a-a706af2166fb
6
6
ms.topic: "overview"
7
7
---
@@ -23,7 +23,7 @@ If a legacy application is running satisfactorily, in a secure environment, and
23
23
24
24
- Build times are faster, because of performance improvements in the compiler and linker.
25
25
26
-
- Better standards conformance. The [/permissive-](../build/reference/permissive-standards-conformance.md) compiler option helps you identify code that doesn't conform to the current C++ standard.
26
+
- Better standards conformance. The [/permissive-](../build/reference/permissive-standards-conformance.md) compiler option helps you identify code that doesn't conform to the current C++ standard. The [new preprocessor](../preprocessor/preprocessor-experimental-overview.md) supports code conformance, too.
27
27
28
28
- Better run-time security, including more secure [C Runtime library](../c-runtime-library/security-features-in-the-crt.md) features. And, compiler features such as [guard checking](../build/reference/guard-enable-guard-checks.md) and address sanitizers (new in Visual Studio 2019 version 16.4).
@@ -16,13 +16,11 @@ Visual Studio 2015 uses the traditional preprocessor, which doesn't conform with
16
16
17
17
We're updating the Microsoft C++ preprocessor to improve standards conformance, fix longstanding bugs, and change some behaviors that are officially undefined. We've also added new diagnostics to warn on errors in macro definitions.
18
18
19
-
These changes are available by using the [/experimental:preprocessor](../build/reference/experimental-preprocessor.md) compiler switch in Visual Studio 2017 or Visual Studio 2019. The default preprocessor behavior remains the same as in previous versions.
20
-
21
-
Starting in Visual Studio 2019 version 16.5, experimental preprocessor support for the C++20 standard is feature-complete.
19
+
Starting in Visual Studio 2019 version 16.5, preprocessor support for the C++20 standard is feature-complete. These changes are available starting in Visual Studio 2019 version 16.5 by using the [/Zc:preprocessor](../build/reference/zc-preprocessor.md) compiler switch. An experimental version is available in earlier versions starting in Visual Studio 2017 version 15.8 by using the [/experimental:preprocessor](../build/reference/experimental-preprocessor.md) compiler switch. The default preprocessor behavior remains the same as in previous versions.
22
20
23
21
## New predefined macro
24
22
25
-
You can detect which preprocessor is in use at compile time. Check the value of the predefined macro [\_MSVC\_TRADITIONAL](predefined-macros.md) to tell if the traditional preprocessor is in use. This macro is set unconditionally by versions of the compiler that support it, independent of which preprocessor is invoked. Its value is 1 for the traditional preprocessor. It's 0 for the conforming preprocessor.
23
+
You can detect which preprocessor is in use at compile time. Check the value of the predefined macro [`_MSVC_TRADITIONAL`](predefined-macros.md) to tell if the traditional preprocessor is in use. This macro is set unconditionally by versions of the compiler that support it, independent of which preprocessor is invoked. Its value is 1 for the traditional preprocessor. It's 0 for the conforming preprocessor.
Starting in Visual Studio 2019 version 16.5, the experimental preprocessor is feature-complete for C++20. In previous versions of Visual Studio, the experimental preprocessor is mostly complete, although some preprocessor directive logic still falls back to the traditional behavior. Here's a partial list of incomplete features in Visual Studio versions before 16.5:
241
+
Starting in Visual Studio 2019 version 16.5, the new preprocessor is feature-complete for C++20. In previous versions of Visual Studio, the experimental preprocessor is mostly complete, although some preprocessor directive logic still falls back to the traditional behavior. Here's a partial list of incomplete features in Visual Studio versions before 16.5:
0 commit comments