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.md
+6-9Lines changed: 6 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -23,7 +23,7 @@ For an in-depth summary of changes made to the Standard Template Library, includ
23
23
24
24
### Conversion operator specialization with explicitly specified return type
25
25
26
-
The compiler used to specialize conversion operators incorrectly in some cases which can lead to mismatched return type. These invalid specializations no longer happen. This is a source code breaking change.
26
+
The compiler used to specialize conversion operators incorrectly in some cases which could lead to mismatched return type. These invalid specializations no longer happen. This is a source code breaking change.
27
27
28
28
```cpp
29
29
// Example 1
@@ -56,7 +56,7 @@ void test()
56
56
57
57
### Added Support for `#elifdef` and `#elifndef`
58
58
59
-
Support added for WG21 p2334r1 (C++23) and WG14 n2645 (C23) which introduced the `#elifdef` and `#elifndef` preprocessor directives.
59
+
Support added for WG21 [P2334R1](https://www.open-std.org/JTC1/SC22/WG21/docs/papers/2021/p2334r1.pdf) (C++23) and WG14 [N2645](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2645.pdf) (C23) which introduced the `#elifdef` and `#elifndef` preprocessor directives.
60
60
Requires `/std:clatest` or `/std:c++latest`.
61
61
62
62
Before:
@@ -87,7 +87,7 @@ After:
87
87
88
88
Applies to the C language (C17 and later). Also added to Microsoft Visual Studio 17.9
89
89
90
-
In versions of Visual C++ before Visual Studio 2022 version 17.9, when the `_Alignas` specifier appeared adjacent to a structured type in a declaration, it wasn't applied correctly according to the ISO-C Standard.
90
+
In versions of Visual C++ before Visual Studio 2022 version 17.9, if the `_Alignas` specifier appeared adjacent to a structured type in a declaration, it wasn't applied correctly according to the ISO-C Standard.
91
91
92
92
```cpp
93
93
// compile with /std:c17
@@ -137,12 +137,9 @@ To get the previous behavior, replace `_Alignas(N)` with `__declspec(align(N))`.
137
137
138
138
### Improved warning C4706
139
139
140
-
This is a source code breaking change. Previously, the compiler didn't detect the convention for suppressing the warning. That is, wrapping the assignment in parentheses (if an assignment really was intended). The compiler now detects the parentheses and suppresses the warning.
141
-
142
-
The compiler now also emits the warning in cases where the function isn't referenced.
140
+
This is a source code breaking change. Previously, the compiler didn't detect the convention of wrapping an assignment in parentheses, if assignment was intended, to suppress the warning. The compiler now detects the parentheses and suppresses the warning.
143
141
144
142
```cpp
145
-
// example
146
143
#pragma warning(error: 4706)
147
144
148
145
structS
@@ -159,14 +156,14 @@ struct S
159
156
};
160
157
```
161
158
162
-
Previously, because `mf` is an inline function that isn't referenced, warning C4706 wasn't emitted for this code. Now the warning is emitted:
159
+
The compiler now also emits the warning in cases where the function isn't referenced. Previously, because `mf` is an inline function that isn't referenced, warning C4706 wasn't emitted for this code. Now the warning is emitted:
163
160
164
161
```cpp
165
162
t.cpp(5): error C4706: assignment used as a condition
166
163
t.cpp(5): note: if an assignment is intended you can enclose it in parentheses, '(e1 = e2)', to silence this warning
167
164
```
168
165
169
-
To fix this warning, either use an equality operator, `value == 9`, if this is what was intended, or wrap the assignment in parentheses, `(value = 9)`, if assignment is what is intended. Or, since the function is unreferenced, remove it.
166
+
To fix this warning, either use an equality operator, `value == 9`, if this is what was intended. Or, wrap the assignment in parentheses, `(value = 9)`, if assignment is intended. Otherwise, since the function is unreferenced, remove it.
170
167
171
168
## <aname="improvements_179"></a> Conformance improvements in Visual Studio 2022 version 17.9
0 commit comments