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
Copy file name to clipboardExpand all lines: docs/overview/cpp-conformance-improvements-2019.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -579,8 +579,8 @@ int main()
579
579
// The conversion from 'E' to the fixed underlying type 'unsigned char' is better than the
580
580
// conversion from 'E' to the promoted type 'unsigned int'.
581
581
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&).
584
584
f(e, B{});
585
585
}
586
586
```
@@ -885,7 +885,7 @@ The non-standard headers \<stdexcpt.h> and \<typeinfo.h> have been removed. Code
885
885
886
886
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.
887
887
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:
889
889
890
890
```cpp
891
891
template <class T>
@@ -1424,7 +1424,7 @@ In Visual Studio 2019 version 16.6 and later, the behavior of **`typedef`** decl
1424
1424
1425
1425
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.
1426
1426
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.
1428
1428
1429
1429
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:
1430
1430
@@ -2101,7 +2101,7 @@ The update may change program behavior that relied on an introduced temporary:
2101
2101
intfunc() {
2102
2102
int i1 = 13;
2103
2103
int i2 = 23;
2104
-
2104
+
2105
2105
int* iptr = &i1;
2106
2106
int const * const& iptrcref = iptr;
2107
2107
@@ -2110,7 +2110,7 @@ int func() {
2110
2110
{
2111
2111
return 1;
2112
2112
}
2113
-
2113
+
2114
2114
// Now change what iptr points to.
2115
2115
2116
2116
// Prior to CWG 2352 iptrcref should be bound to a temporary and still points to the value 13.
@@ -2151,7 +2151,7 @@ class B {
2151
2151
2152
2152
template <typenameT>
2153
2153
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
2155
2155
// using the same noexcept-specifier. For example,
2156
2156
// B<T>::~B() noexcept { /* ... */ }
2157
2157
```
@@ -2254,7 +2254,7 @@ Earlier versions of the compiler would incorrectly convert the argument of `f` f
2254
2254
This change can also correct the chosen overload in some other situations:
0 commit comments