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).
@@ -28,6 +29,7 @@ These are the **`/Zc`** compiler options:
28
29
|[`/ZcimplicitNoexcept`](zc-implicitnoexcept-implicit-exception-specifiers.md)| Enable implicit **`noexcept`** on required functions (on by default). |
29
30
|[`/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
31
|[`/Zc:noexceptTypes`](zc-noexcepttypes.md)| Enforce C++17 **`noexcept`** rules (on by default in C++17 or later). |
32
+
|[`/Zc:preprocessor`](zc-preprocessor.md)| Use the new conforming preprocessor (off by default, except in C11/C17). |
31
33
|[`/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
34
|[`/Zc:rvalueCast`](zc-rvaluecast-enforce-type-conversion-rules.md)| Enforce Standard C++ explicit type conversion rules (off by default). |
33
35
|[`/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/overview/cpp-conformance-improvements.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -738,7 +738,7 @@ int main() {
738
738
739
739
### Preprocessor output preserves newlines
740
740
741
-
The experimental preprocessor now preserves newlines and whitespace when using **`/P`** or **`/E`** with **`/experimental:preprocessor`**. This change can be disabled by using **`/d1experimental:preprocessor:oldWhitespace`**.
741
+
The experimental preprocessor now preserves newlines and whitespace when using **`/P`** or **`/E`** with **`/experimental:preprocessor`**.
Copy file name to clipboardExpand all lines: docs/overview/what-s-new-for-visual-cpp-in-visual-studio.md
+2-1
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,6 @@
1
1
---
2
2
title: "What's new for C++ in Visual Studio"
3
+
description: "The new features and fixes in the Microsoft C/C++ compiler and tools in Visual Studio."
3
4
ms.date: "05/19/2020"
4
5
ms.technology: "cpp-ide"
5
6
ms.assetid: 8801dbdb-ca0b-491f-9e33-01618bff5ae9
@@ -251,7 +252,7 @@ The MSVC compiler toolset in Visual Studio version 15.7 now conforms with the C+
251
252
252
253
##### Visual Studio 2017 version 15.8
253
254
254
-
The [`/experimental:preprocessor`](../build/reference/experimental-preprocessor.md) compiler switch enables the new experimental MSVC preprocessor that will eventually conform to all applicable C and C++ standards. For more information, see [MSVC experimental preprocessor overview](../preprocessor/preprocessor-experimental-overview.md).
255
+
The [`/experimental:preprocessor`](../build/reference/experimental-preprocessor.md) compiler switch enables the new experimental MSVC preprocessor that will eventually conform to all applicable C and C++ standards. For more information, see [MSVC new preprocessor overview](../preprocessor/preprocessor-experimental-overview.md).
Copy file name to clipboardExpand all lines: docs/porting/visual-cpp-porting-and-upgrading-guide.md
+2-2
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).
The *C/C++ preprocessor reference* explains the preprocessor as it is implemented in Microsoft C/C++. The preprocessor performs preliminary operations on C and C++ files before they are passed to the compiler. You can use the preprocessor to conditionally compile code, insert files, specify compile-time error messages, and apply machine-specific rules to sections of code.
10
11
11
-
In Visual Studio 2019 the [/experimental:preprocessor](../build/reference/experimental-preprocessor.md) compiler option enables a new implementation of the preprocessor. The new implementation is still in progress, and is therefore considered experimental. It is intended to eventually be conformant with C99, C11, and C++20. For more information, see [MSVC experimental preprocessor overview](preprocessor-experimental-overview.md).
12
+
In Visual Studio 2019 the [/experimental:preprocessor](../build/reference/experimental-preprocessor.md) compiler option enables a new implementation of the preprocessor. The new implementation is still in progress, and is therefore considered experimental. It is intended to eventually be conformant with C99, C11, and C++20. For more information, see [MSVC new preprocessor overview](preprocessor-experimental-overview.md).
12
13
13
14
## In this section
14
15
15
16
[Preprocessor](preprocessor.md)\
16
-
Provides an overview of the traditional and new experimental preprocessors.
17
+
Provides an overview of the traditional and new conforming preprocessors.
Discusses pragmas, which offer a way for each compiler to offer machine- and operating system-specific features while retaining overall compatibility with the C and C++ languages.
0 commit comments