Skip to content

Commit 33b853d

Browse files
authored
Merge pull request #5535 from MicrosoftDocs/FromPublicMasterBranch
Confirm merge from FromPublicMasterBranch to main to sync with https://github.com/MicrosoftDocs/cpp-docs (branch main)
2 parents 18acc93 + 27a46ce commit 33b853d

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

docs/build/reference/std-specify-language-standard-version.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "/std (Specify Language Standard Version)"
33
description: "The MSVC compiler option /std specifies the C or C++ language standard supported by the compiler."
4-
ms.date: 11/13/2023
4+
ms.date: 4/5/2023
55
f1_keywords: ["/std", "-std", "/std:c++14", "/std:c++17", "/std:c++20", "/std:c11", "/std:c17", "/std:clatest", "VC.Project.VCCLCompilerTool.CppLanguageStandard"]
66
---
77
# `/std` (Specify Language Standard Version)
@@ -28,6 +28,15 @@ The Microsoft C++ compiler in Visual Studio 2017 and later versions doesn't supp
2828

2929
The **`/std`** option in effect during a C++ compilation can be detected by use of the [`_MSVC_LANG`](../../preprocessor/predefined-macros.md) preprocessor macro. For more information, see [Preprocessor Macros](../../preprocessor/predefined-macros.md).
3030

31+
> [!IMPORTANT]
32+
> Because some existing code depends on the value of the macro `__cplusplus` being 199711L, the MSVC compiler doesn't change the value of this macro unless you explicitly opt in by setting [`/Zc:__cplusplus`](zc-cplusplus.md). Here are the values for `__cplusplus` depending on the language version you are compiling with:
33+
>
34+
> | Language version | __cplusplus value |
35+
> |------------------|-------------------|
36+
> | `/std:c++14` | 201402 |
37+
> | `/std:c++17` | 201703 |
38+
> | `/std:c++20` | 202002 |
39+
3140
**`/std:c++14`**\
3241
The **`/std:c++14`** option enables C++14 standard-specific features implemented by the MSVC compiler. This option is the default for code compiled as C++. It's available starting in Visual Studio 2015 Update 3.
3342

@@ -123,5 +132,6 @@ For more information, see the C Standard library features section of [Microsoft
123132

124133
## See also
125134

126-
[MSVC compiler options](compiler-options.md)<br/>
135+
[`/Zc:__cplusplus[-]`](zc-cplusplus.md)\
136+
[MSVC compiler options](compiler-options.md)\
127137
[MSVC compiler command-line syntax](compiler-command-line-syntax.md)

0 commit comments

Comments
 (0)