Skip to content

Commit e388853

Browse files
TylerMSFTTylerMSFT
authored andcommitted
reflect new behavior as of 17.6
1 parent 05e437e commit e388853

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

docs/build/reference/zc-externconstexpr.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
---
22
description: "Learn more about: `/Zc:externConstexpr` (Enable extern constexpr variables)"
33
title: "/Zc:externConstexpr (Enable extern constexpr variables)"
4-
ms.date: "02/28/2018"
4+
ms.date: 10/12/2023
55
f1_keywords: ["/Zc:externConstexpr"]
66
helpviewer_keywords: ["-Zc:externConstexpr compiler option (C++)", "extern constexpr variables (C++)"]
7-
ms.assetid: 4da5e33a-2e4d-4ed2-8616-bd8f43265c27
87
---
98
# `/Zc:externConstexpr` (Enable extern constexpr variables)
109

@@ -16,7 +15,11 @@ The **`/Zc:externConstexpr`** compiler option tells the compiler to conform to t
1615
1716
## Remarks
1817

19-
The **`/Zc:externConstexpr`** compiler option causes the compiler to apply external linkage to variables declared by using `extern constexpr`. In earlier versions of Visual Studio, and by default or if **`/Zc:externConstexpr-`** is specified, Visual Studio applies internal linkage to **`constexpr`** variables even if the **`extern`** keyword is used. The **`/Zc:externConstexpr`** option is available starting in Visual Studio 2017 Update 15.6. and is off by default. The [`/permissive-`](permissive-standards-conformance.md) option does not enable **`/Zc:externConstexpr`**.
18+
The **`/Zc:externConstexpr`** compiler option causes the compiler to apply external linkage to variables declared by using `extern constexpr`.
19+
20+
In earlier versions of Visual Studio, by default or if **`/Zc:externConstexpr-`** is specified, Visual Studio applies internal linkage to **`constexpr`** variables even if the **`extern`** keyword is used. The **`/Zc:externConstexpr`** option is available starting in Visual Studio 2017 Update 15.6. and is off by default.
21+
22+
As of Visual Studio 2022 Update 17.6, the `/permissive-` option enables both `/Zc:lambda` and `/Zc:externConstexpr`. In prior versions, neither were enabled by `/permissive-`.
2023

2124
If a header file contains a variable declared `extern constexpr`, it must be marked [`__declspec(selectany)`](../../cpp/selectany.md) in order to merge the duplicate declarations into a single instance in the linked binary. Otherwise you may see linker errors, for example, LNK2005, for violations of the one-definition rule.
2225

0 commit comments

Comments
 (0)