Skip to content

Commit e514375

Browse files
Merge pull request #5642 from Rageking8/fix-and-update-cpp-conformance-improvements-2019
Fix and update "C++ Conformance improvements, behavior changes, and bug fixes in Visual Studio 2019"
2 parents f4c0470 + 93a81c7 commit e514375

1 file changed

Lines changed: 12 additions & 12 deletions

File tree

docs/overview/cpp-conformance-improvements-2019.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ To avoid the errors, insert a space in the offending line before the final angle
6767

6868
### References to types with mismatched cv-qualifiers
6969

70-
>[!Note]
71-
> This change only affects Visual Studio 2019 versions 16.0 through 16.8. It was reverted starting in Visual Studio 2019 version 16.9
70+
> [!NOTE]
71+
> This change only affects Visual Studio 2019 versions 16.0 through 16.8. It was reverted starting in Visual Studio 2019 version 16.9.
7272
7373
Previously, MSVC allowed direct binding of a reference from a type with mismatched cv-qualifiers below the top level. This binding could allow modification of supposedly const data referred to by the reference.
7474

@@ -455,7 +455,7 @@ The `std::bitset` constructor no longer reads the ones and zeroes in reverse ord
455455
456456
### `std::pair::operator=` regression
457457
458-
We fixed a regression in the `std::pair` assignment operator introduced when implementing [LWG 2729 "Missing SFINAE on `std::pair::operator=`";](https://cplusplus.github.io/LWG/issue2729). It now correctly accepts types convertible to `std::pair` again.
458+
We fixed a regression in the `std::pair` assignment operator introduced when implementing [LWG 2729 "Missing SFINAE on `std::pair::operator=`"](https://cplusplus.github.io/LWG/issue2729). It now correctly accepts types convertible to `std::pair` again.
459459
460460
### Non-deduced contexts for `add_const_t`
461461
@@ -579,8 +579,8 @@ int main()
579579
// The conversion from 'E' to the fixed underlying type 'unsigned char' is better than the
580580
// conversion from 'E' to the promoted type 'unsigned int'.
581581
f(e);
582-
583-
// Error C2666. This call is ambiguous, but previously called f(unsigned int, const B&).
582+
583+
// Error C2666. This call is ambiguous, but previously called f(unsigned int, const B&).
584584
f(e, B{});
585585
}
586586
```
@@ -694,7 +694,7 @@ std::equal(std::begin(a), std::end(a), std::begin(b), std::end(b));
694694
695695
### Effect of defining spaceship operator on `==` and `!=`
696696
697-
A definition of the spaceship operator (**`<=>`**) alone will no longer rewrite expressions involving **`==`** or **`!=`** unless the spaceship operator is marked as **`= default`** ([P1185R2](https://wg21.link/p1185r2)). The following example compiles in Visual Studio 2019 RTW and version 16.1, but produces C2678 in Visual Studio 2019 version 16.2:
697+
A definition of the spaceship operator (**`<=>`**) alone will no longer rewrite expressions involving **`==`** or **`!=`** unless the spaceship operator is marked as **`= default`** ([P1185R2](https://wg21.link/p1185r2)). The following example compiles in Visual Studio 2019 RTW and version 16.1, but produces C2676 in Visual Studio 2019 version 16.2:
698698
699699
```cpp
700700
#include <compare>
@@ -885,7 +885,7 @@ The non-standard headers \<stdexcpt.h> and \<typeinfo.h> have been removed. Code
885885
886886
Two-phase name lookup requires that non-dependent names used in template bodies must be visible to the template at definition time. Previously, such names may have been found when the template is instantiated. This change makes it easier to write portable and conforming code in MSVC under the [`/permissive-`](../build/reference/permissive-standards-conformance.md) flag.
887887
888-
In Visual Studio 2019 version 16.4 with the **`/permissive-`** flag set, the following example produces an error, because `N::f` isn't visible when the `f<T>` template is defined:
888+
In Visual Studio 2019 version 16.4 with the **`/permissive-`** flag set, the following example produces an error, because `N::f` isn't visible when the `f<T>` template is defined:
889889
890890
```cpp
891891
template <class T>
@@ -1424,7 +1424,7 @@ In Visual Studio 2019 version 16.6 and later, the behavior of **`typedef`** decl
14241424

14251425
The same restrictions are applied recursively to each nested class. The restriction is meant to ensure the simplicity of structs that have **`typedef`** names for linkage purposes. They must be simple enough that no linkage calculations are necessary before the compiler gets to the **`typedef`** name for linkage.
14261426

1427-
This change affects all standards modes of the compiler. In default (**`/std:c++14`**) and **`/std:c++17`** modes, the compiler emits warning C5208 for non-conforming code. If **`/permissive-`** is specified, the compiler emits warning C5208 as an error under **`/std:c++14`** and emits error C7626 under **`/std:c++17`**. The compiler emits error C7626 for non-conforming code when **`/std:c++20`** or **`/std:c++latest`** is specified.
1427+
This change affects all standards modes of the compiler. In default (**`/std:c++14`**) and **`/std:c++17`** modes, the compiler emits warning C5208 for non-conforming code. If **`/permissive-`** is specified, the compiler emits warning C5208 as an error under **`/std:c++14`** and emits error C7626 under **`/std:c++17`**. The compiler emits error C7626 for non-conforming code when **`/std:c++20`** or **`/std:c++latest`** is specified.
14281428

14291429
The following sample shows the constructs that are no longer allowed in unnamed structs. Depending on the standards mode specified, C5208 or C7626 errors or warnings are emitted:
14301430

@@ -2101,7 +2101,7 @@ The update may change program behavior that relied on an introduced temporary:
21012101
int func() {
21022102
int i1 = 13;
21032103
int i2 = 23;
2104-
2104+
21052105
int* iptr = &i1;
21062106
int const * const& iptrcref = iptr;
21072107

@@ -2110,7 +2110,7 @@ int func() {
21102110
{
21112111
return 1;
21122112
}
2113-
2113+
21142114
// Now change what iptr points to.
21152115

21162116
// Prior to CWG 2352 iptrcref should be bound to a temporary and still points to the value 13.
@@ -2151,7 +2151,7 @@ class B {
21512151

21522152
template <typename T>
21532153
B<T>::~B() { /* ... */ } // Before: no diagnostic.
2154-
// Now diagnoses a definition mismatch. To fix, define the implementation by
2154+
// Now diagnoses a definition mismatch. To fix, define the implementation by
21552155
// using the same noexcept-specifier. For example,
21562156
// B<T>::~B() noexcept { /* ... */ }
21572157
```
@@ -2254,7 +2254,7 @@ Earlier versions of the compiler would incorrectly convert the argument of `f` f
22542254
This change can also correct the chosen overload in some other situations:
22552255

22562256
```cpp
2257-
struct Base
2257+
struct Base
22582258
{
22592259
operator char *();
22602260
};

0 commit comments

Comments
 (0)