Skip to content

Commit 8fd1f91

Browse files
author
3836425+corob-msft@users.noreply.github.com
committed
The other half of the /std:c++20 fixes
1 parent 8fdae41 commit 8fd1f91

29 files changed

Lines changed: 85 additions & 81 deletions

docs/overview/cpp-conformance-improvements.md

Lines changed: 28 additions & 27 deletions
Large diffs are not rendered by default.

docs/overview/visual-cpp-language-conformance.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -516,9 +516,9 @@ These algorithms aren't presently parallelized:
516516

517517
<a name="note_14"></a> __14__ These C++17 and C++20 features are always enabled, even when [`/std:c++14`](../build/reference/std-specify-language-standard-version.md) (the default) is specified. The reason is either because the feature was implemented before the introduction of the **`/std`** options, or because conditional implementation was undesirably complex.
518518

519-
<a name="note_17"></a> __17__ These features are enabled by the [`/std:c++17`](../build/reference/std-specify-language-standard-version.md) (or [`/std:c++latest`](../build/reference/std-specify-language-standard-version.md)) compiler option.
519+
<a name="note_17"></a> __17__ These features are enabled by the [`/std:c++17`](../build/reference/std-specify-language-standard-version.md) or later compiler option.
520520

521-
<a name="note_20"></a> __20__ In versions through Visual Studio 2019 version 16.10, these features are enabled by the [`/std:c++latest`](../build/reference/std-specify-language-standard-version.md) compiler option. When the C++20 implementation is complete, we'll add a new **`/std:c++20`** compiler option to enable these features.
521+
<a name="note_20"></a> __20__ In versions through Visual Studio 2019 version 16.10, these features are enabled by the [`/std:c++latest`](../build/reference/std-specify-language-standard-version.md) compiler option. Visual Studio 2019 version 16.11 added the [`/std:c++20`](../build/reference/std-specify-language-standard-version.md) compiler option to enable these features.
522522

523523
<a name="note_DR"></a> __DR__ These features are enabled in all C++ [`/std`](../build/reference/std-specify-language-standard-version.md) compiler option modes. The C++ Standard committee adopted this change as a retroactive Defect Report to C++11 and all later versions.
524524

docs/overview/what-s-new-for-visual-cpp-in-visual-studio.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ For a summary of new features and bug fixes in Visual Studio version 16.9, see [
6666

6767
For a summary of new features and bug fixes in Visual Studio version 16.8, see [What's New in Visual Studio 2019 version 16.8](/visualstudio/releases/2019/release-notes-v16.8).
6868

69-
- C++20 Coroutines are now supported under [`/std:c++latest`](../build/reference/std-specify-language-standard-version.md) and the \<coroutine> header.
69+
- C++20 Coroutines are now supported under [`/std:c++latest`](../build/reference/std-specify-language-standard-version.md) (or **`/std:c++20`** starting in Visual Studio 2019 version 16.11) and the \<coroutine> header.
7070

7171
- IntelliSense now provides support for C++20 \<concepts> and \<ranges> headers, and rename and browsing for concept definitions.
7272

@@ -178,7 +178,7 @@ For a summary of new features and bug fixes in Visual Studio version 16.4, see [
178178

179179
- Updates to MSVC's C++ Standard Library:
180180
- C++17: Implemented `to_chars()` general precision, completing [P0067R5](https://wg21.link/P0067R5) Elementary String Conversions (charconv). This completes implementation of all library features in the C++17 Standard.
181-
- C++20: Implemented [P1754R1](https://wg21.link/P1754R1) Rename concepts to standard_case. To include preview features from the latest C++ Working Draft, use the **`/std:c++latest`** compiler option. The option can also be set in the **Configuration Properties > C/C++ > Language** project property page using the **C++ Language Standard** property.
181+
- C++20: Implemented [P1754R1](https://wg21.link/P1754R1) Rename concepts to standard_case. To include preview features from the latest C++ Working Draft, use the **`/std:c++latest`** compiler option (or **`/std:c++20`** starting in Visual Studio 2019 version 16.11). The option can also be set in the **Configuration Properties > C/C++ > Language** project property page using the **C++ Language Standard** property.
182182

183183
- A new collection of tools named [C++ Build Insights](../build-insights/get-started-with-cpp-build-insights.md) is now available. For more information about the announcement, see the [C++ Team Blog](https://devblogs.microsoft.com/cppblog/introducing-c-build-insights/).
184184

@@ -190,7 +190,7 @@ For a summary of new features and bug fixes in Visual Studio version 16.3, see [
190190

191191
- IntelliSense member lists are now filtered based on type qualifiers, for example, `const std::vector` now filters out methods such as `push_back`.
192192

193-
- We added these C++20 Standard Library preview features (available under **`/std:c++latest`**):
193+
- We added these C++20 Standard Library preview features (available under **`/std:c++latest`**, or **`/std:c++20`** starting in Visual Studio 2019 version 16.11):
194194
- [P0487R1](https://wg21.link/P0487R1): Fixing `operator>>(basic_istream&, CharT*)`
195195
- [P0616R0](https://wg21.link/P0616R0): Using `move()` In `<numeric>`
196196
- [P0758R1](https://wg21.link/P0758R1): `is_nothrow_convertible`
@@ -227,12 +227,12 @@ For a summary of new features and bug fixes in Visual Studio version 16.2, see [
227227
- Optimized `chars_format::fixed` shortest
228228

229229
- Added these C++20 Standard Library preview features:
230-
- Available under **`/std:c++latest`**:
230+
- Available under **`/std:c++latest`** (or **`/std:c++20`** starting in Visual Studio 2019 version 16.11):
231231
- [P0020R6](https://wg21.link/P0020R6)`atomic<floating-point>`
232232
- [P0463R1](https://wg21.link/P0463R1): endian enumeration
233233
- [P0482R6](https://wg21.link/P0482R6)`char8_t` type for UTF-8 characters and strings
234234
- [P0653R2](https://wg21.link/P0653R2)`to_address()` for converting a pointer to a raw pointer
235-
- Available under `/std:c++17` and `/std:c++latest`:
235+
- Available under `/std:c++17` and `/std:c++latest` (or **`/std:c++20`** starting in Visual Studio 2019 version 16.11):
236236
- [P0600R1](https://wg21.link/P0600R1)`[[nodiscard]]` in the library
237237
- Available unconditionally:
238238
- [P0754R2](https://wg21.link/P0754R2)`<version>` header
@@ -248,7 +248,7 @@ For a summary of new features and bug fixes in Visual Studio version 16.1, see [
248248

249249
### C++ compiler
250250

251-
- These C++20 preview features have been implemented in the C++ compiler, available under **`/std:c++latest`**:
251+
- These C++20 preview features have been implemented in the C++ compiler, available under **`/std:c++latest`** (or **`/std:c++20`** starting in Visual Studio 2019 version 16.11):
252252
- Increased ability to find function templates via argument-dependent lookup for function call expressions with explicit template arguments ([P0846R0](http://wg21.link/p0846r0)).
253253
- Designated initialization ([P0329R4](https://wg21.link/p0329r4)), which allows specific members to be selected in aggregate initialization, for example, by using the `Type t { .member = expr }` syntax.
254254

docs/porting/ide-tools-for-upgrading-code.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ Visual Studio helps you upgrade legacy C++ code with compiler options, code anal
1010

1111
- Code that was formerly allowed by the Microsoft C++ compiler (MSVC) but never conformed to the C++ standard.
1212

13-
To upgrade older non-conformant MSVC code, turn on the [/permissive-](../build/reference/permissive-standards-conformance.md) compiler option. All instances of non-conformant usages are underlined with red squiggles in the code editor. The error messages in the **Error List** window include a recommendation for how to fix the error. Click on the error code to go to its help page in the documentation. If fixing all the errors at once is impractical, you can upgrade non-conformant code in stages by turning on the **permissive-** option, fixing some errors, then turning the option off again. The code will compile with the new improvements, and you can go back and fix the remaining issues at a later time. See the [/permissive-](../build/reference/permissive-standards-conformance.md) page for examples of non-conformant MSVC code.
13+
To upgrade older non-conforming MSVC code, turn on the [`/permissive-`](../build/reference/permissive-standards-conformance.md) compiler option. All instances of non-conforming usages are underlined with red squiggles in the code editor. The error messages in the **Error List** window include a recommendation for how to fix the error. Click on the error code to go to its help page in the documentation. If fixing all the errors at once is impractical, you can upgrade non-conforming code in stages by turning on the **`/permissive-`** option, fixing some errors, then turning the option off again. The code will compile with the new improvements, and you can go back and fix the remaining issues at a later time. See the [`/permissive-`](../build/reference/permissive-standards-conformance.md) page for examples of non-conforming MSVC code.
1414

1515
- Code that was permitted in an earlier version of the C++ standard but has been deprecated or removed in a later version.
1616

17-
To upgrade to a newer language standard, set the [C++ Language Standard](../build/reference/std-specify-language-standard-version.md) option to the desired standard and fix any compile errors that are raised. In general, we recommend setting the language standard to [/std:c++17](../build/reference/std-specify-language-standard-version.md). The errors raised when upgrading to a newer standard are not related to the errors raised when using the **permissive-** option.
17+
To upgrade to a newer language standard, set the [C++ Language Standard](../build/reference/std-specify-language-standard-version.md) option to the desired standard and fix any compile errors that are raised. In general, we recommend setting the language standard to [`/std:c++17`](../build/reference/std-specify-language-standard-version.md) or [`/std:c++20`](../build/reference/std-specify-language-standard-version.md). The errors raised when upgrading to a newer standard are not related to the errors raised when using the **`/permissive-`** option.
1818

1919
- Code that conforms to all versions of the standard but is no longer considered best practice in modern C++.
2020

docs/preprocessor/predefined-macros.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ MSVC supports these additional predefined macros.
285285

286286
For more information, see [Visual C++ Compiler Version](https://devblogs.microsoft.com/cppblog/visual-c-compiler-version/) in the Microsoft C++ Team Blog.
287287

288-
- `_MSVC_LANG` Defined as an integer literal that specifies the C++ language standard targeted by the compiler. It's set only in code compiled as C++. The macro is the integer literal value 201402L by default, or when the [`/std:c++14`](../build/reference/std-specify-language-standard-version.md) compiler option is specified. The macro is set to 201703L if the [`/std:c++17`](../build/reference/std-specify-language-standard-version.md) compiler option is specified. It's set to a higher, unspecified value when the [`/std:c++latest`](../build/reference/std-specify-language-standard-version.md) option is specified. Otherwise, the macro is undefined. The `_MSVC_LANG` macro and [**`/std`** (Specify Language Standard Version)](../build/reference/std-specify-language-standard-version.md) compiler options are available beginning in Visual Studio 2015 Update 3.
288+
- `_MSVC_LANG` Defined as an integer literal that specifies the C++ language standard targeted by the compiler. It's set only in code compiled as C++. The macro is the integer literal value `201402L` by default, or when the [`/std:c++14`](../build/reference/std-specify-language-standard-version.md) compiler option is specified. The macro is set to `201703L` if the [`/std:c++17`](../build/reference/std-specify-language-standard-version.md) compiler option is specified. The macro is set to `202002L` if the [`/std:c++20`](../build/reference/std-specify-language-standard-version.md) compiler option is specified. It's set to a higher, unspecified value when the [`/std:c++latest`](../build/reference/std-specify-language-standard-version.md) option is specified. Otherwise, the macro is undefined. The `_MSVC_LANG` macro and [`/std` (Specify language standard version)](../build/reference/std-specify-language-standard-version.md) compiler options are available beginning in Visual Studio 2015 Update 3.
289289

290290
- `__MSVC_RUNTIME_CHECKS` Defined as 1 when one of the [`/RTC`](../build/reference/rtc-run-time-error-checks.md) compiler options is set. Otherwise, undefined.
291291

docs/standard-library/basic-string-class.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1575,7 +1575,7 @@ If you modify the contents of the string returned by the `const` overload of `da
15751575

15761576
Before C++11, `data` didn't guarantee the returned string was null-terminated. Since C++11, `data` and `c_str` both return a null-terminated string, and are effectively the same.
15771577

1578-
The non-`const` overload is new in C++17. To use it, specify the **`/std:c++17`** or **`/std:c++latest`** compiler option.
1578+
The non-`const` overload is new in C++17. To use it, specify the **`/std:c++17`** or later compiler option.
15791579

15801580
### Example
15811581

@@ -1820,14 +1820,14 @@ Null-terminated character string containing the suffix to look for.
18201820
18211821
### Remarks
18221822
1823-
`ends_with()` is new in C++20. To use it, specify the [`/std:c++latest`](../build/reference/std-specify-language-standard-version.md) compiler option.
1823+
`ends_with()` is new in C++20. To use it, specify the [`/std:c++20`](../build/reference/std-specify-language-standard-version.md) or later compiler option.
18241824
18251825
See [`starts_with`](#starts_with) to check if a string starts with the specified prefix.
18261826
18271827
### Example
18281828
18291829
```cpp
1830-
// Requires /std:c++latest
1830+
// Requires /std:c++20 or /std:c++latest
18311831
#include <string>
18321832
#include <iostream>
18331833
@@ -4641,14 +4641,14 @@ Null-terminated character string containing the prefix to look for.
46414641
46424642
### Remarks
46434643
4644-
`starts_with()` is new in C++20. To use it, specify the [`/std:c++latest`](../build/reference/std-specify-language-standard-version.md) compiler option.
4644+
`starts_with()` is new in C++20. To use it, specify the [`/std:c++20`](../build/reference/std-specify-language-standard-version.md) or later compiler option.
46454645
46464646
See [`ends_with`](#ends_with) to see if a string ends with the specified suffix.
46474647
46484648
### Example
46494649
46504650
```cpp
4651-
// Requires /std:c++latest
4651+
// Requires /std:c++20 or /std:c++latest
46524652
#include <string>
46534653
#include <iostream>
46544654

docs/standard-library/basic-string-view-class.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ If a function is asked to generate a sequence longer than [max_size](#max_size)
141141

142142
## Requirements
143143

144-
[std:c++17](../build/reference/std-specify-language-standard-version.md) or later.
144+
[`std:c++17`](../build/reference/std-specify-language-standard-version.md) or later.
145145

146146
**Header:** \<string_view>
147147

@@ -606,14 +606,14 @@ Null-terminated character string containing the suffix to look for.
606606
607607
### Remarks
608608
609-
`ends_with()` is new in C++20. To use it, specify the [/std:c++latest](../build/reference/std-specify-language-standard-version.md) compiler option.
609+
`ends_with()` is new in C++20. To use it, specify the [`/std:c++20`](../build/reference/std-specify-language-standard-version.md) or later compiler option.
610610
611611
See [starts_with](#starts_with) to check if a string view starts with the specified prefix.
612612
613613
### Example
614614
615615
```cpp
616-
// Requires /std:c++latest
616+
// Requires /std:c++20 or /std:c++latest
617617
#include <string>
618618
#include <iostream>
619619
@@ -1016,14 +1016,14 @@ Null-terminated character string containing the prefix to look for.
10161016
10171017
### Remarks
10181018
1019-
`starts_with()` is new in C++20. To use it, specify the [/std:c++latest](../build/reference/std-specify-language-standard-version.md) compiler option.
1019+
`starts_with()` is new in C++20. To use it, specify the [/std:c++20](../build/reference/std-specify-language-standard-version.md) or later compiler option.
10201020
10211021
See [ends_with](#ends_with) to see if a string ends with a suffix.
10221022
10231023
### Example
10241024
10251025
```cpp
1026-
// Requires /std:c++latest
1026+
// Requires /std:c++20 or /std:c++latest
10271027
#include <string>
10281028
#include <iostream>
10291029

docs/standard-library/bit-enum.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ All native scalar types are little-endian for the platforms that Microsoft Visua
3636
3737
**Namespace:** std
3838
39-
[/std:c++latest](../build/reference/std-specify-language-standard-version.md) is required.
39+
[`/std:c++20`](../build/reference/std-specify-language-standard-version.md) or later is required.
4040
4141
## See also
4242

docs/standard-library/bit-functions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -703,7 +703,7 @@ This template function only participates in overload resolution if `T` is an uns
703703

704704
**Namespace:** std
705705

706-
[/std:c++latest](../build/reference/std-specify-language-standard-version.md) is required.
706+
[`/std:c++20`](../build/reference/std-specify-language-standard-version.md) or later is required.
707707

708708
## See also
709709

docs/standard-library/bit.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ For example, there are functions to rotate bits, find the number of consecutive
1818

1919
**Namespace:** std
2020

21-
[/std:c++latest](../build/reference/std-specify-language-standard-version.md) is required.
21+
[`/std:c++20`](../build/reference/std-specify-language-standard-version.md) or later is required.
2222

2323
## Members
2424

0 commit comments

Comments
 (0)