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/top/cpp-conformance-improvements-2017.md
+12-7Lines changed: 12 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,11 +32,11 @@ translation.priority.ht:
32
32
# C++ conformance improvements in [!INCLUDE[vs_dev15_md](../misc/includes/vs_dev15_md.md)]
33
33
34
34
## New language features
35
-
ith support for generalized constexpr and NSDMI for aggregates, the compiler is complete for features added in the C++14 Standard. Note that the compiler still lacks a few features from the C++11 and C++98 Standards.
35
+
With support for generalized constexpr and NSDMI for aggregates, the compiler is now complete for features added in the C++14 Standard. Note that the compiler still lacks a few features from the C++11 and C++98 Standards.
36
36
37
37
### C++11:
38
38
**Expression SFINAE (via more libraries) support in more libraries**
39
-
The Visual C++ compiler is now capable continues to improve its support for expression SFINAE, which is required for template argument deduction and substitution where decltype and constexpr expressions may appear as template parameters. For more information, see [Expression SFINAE improvements in VS 2015 Update 3](https://blogs.msdn.microsoft.com/vcblog/2016/06/07/expression-sfinae-improvements-in-vs-2015-update-3).
39
+
The Visual C++ compiler continues to improve its support for expression SFINAE, which is required for template argument deduction and substitution where decltype and constexpr expressions may appear as template parameters. For more information, see [Expression SFINAE improvements in VS 2015 Update 3](https://blogs.msdn.microsoft.com/vcblog/2016/06/07/expression-sfinae-improvements-in-vs-2015-update-3).
40
40
41
41
42
42
### C++ 14:
@@ -46,7 +46,7 @@ An aggregate is an array or a class with no user-provided constructor, no privat
46
46
**Extended constexpr**
47
47
Expressions declared as constexpr are now allowed to contain certain kinds of declarations, if and switch statements, loop statements, and mutation of objects whose lifetime began within the constexpr expression evaluation. Also, there is no longer a requirement that a constexpr non-static member function be implicitly const. For more information, see [Relaxing constraints on constexpr functions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3652.html).
48
48
49
-
### C++17 (available with /std:c++latest):
49
+
### C++17:
50
50
**Terse static_assert** (available with /std:c++latest)
51
51
In C++17 the message parameter for static_assert is optional. For more information, see [Extending static_assert, v2](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3928.pdf).
52
52
@@ -62,6 +62,7 @@ For the complete list of conformance improvements up through Visual Studio 2015,
62
62
## Bug fixes
63
63
### Copy-list-initialization
64
64
Visual Studio 2017 correctly raises compiler errors related to object creation using initializer lists that were not caught in Visual Studio 2015 and could lead to crashes or undefined runtime behavior. In copy-list-initialization, the compiler is required to consider an explicit constructor for overload resolution, but must raise an error if that overload is actually chosen.
65
+
65
66
The following two examples compile in Visual Studio 2015 but not in Visual Studio 2017.
66
67
```cpp
67
68
structA
@@ -188,7 +189,7 @@ int main()
188
189
// as an argument to a variadic function
189
190
}
190
191
```
191
-
To correct the error, you can callC2672 a member function that returns a trivially copyable type,
192
+
To correct the error, you can call a member function that returns a trivially copyable type,
192
193
193
194
```cpp
194
195
std::atomic<int> i(0);
@@ -200,6 +201,7 @@ or else perform a static cast to convert the object before passing it:
200
201
printf("%i\n", static_cast<int>(s))
201
202
```
202
203
For strings built and managed using CStringW, the provided ‘operator LPCWSTR()’ should be used to cast a CStringW object to the C pointer expected by the format string.
204
+
203
205
```cpp
204
206
CStringW str1;
205
207
CStringW str2;
@@ -245,13 +247,15 @@ In Visual Studio 2015 and earlier, the compiler did not diagnose missing templat
245
247
```cpp
246
248
template <classT> classListNode;
247
249
template <classT> using ListNodeMember = ListNode<T> T::*;
248
-
template <classT, ListNodeMember M> class ListHead; // C2955: 'ListNodeMember': use of alias template requires template argument list
250
+
template <classT, ListNodeMember M> class ListHead; // C2955: 'ListNodeMember': use of alias
251
+
// template requires template argument list
249
252
250
253
// correct: template <class T, ListNodeMember<T> M> class ListHead;
251
254
```
252
255
253
256
### Expression-SFINAE
254
-
As part of supporting expression-SFINAE the compiler now parses decltype arguments when the templates are declared rather than instantiated. Consequently, if a non-dependent specialization is found in the decltype argument, it will not be deferred to instantiation-time and will be processed immediately and any resulting errors will be diagnosed at that time.
257
+
To support expression-SFINAE, the compiler now parses decltype arguments when the templates are declared rather than instantiated. Consequently, if a non-dependent specialization is found in the decltype argument, it will not be deferred to instantiation-time and will be processed immediately and any resulting errors will be diagnosed at that time.
258
+
255
259
The following example shows such a compiler error that is raised at the point of declaration:
256
260
257
261
```cpp
@@ -279,7 +283,8 @@ In Visual Studio 2015 and earlier, the compiler permitted (but ignored) a defaul
279
283
```cpp
280
284
value structV
281
285
{
282
-
int i = 0; // error C3446: 'V::i': a default member initializer is not allowed for a member of a value class
286
+
int i = 0; // error C3446: 'V::i': a default member initializer
0 commit comments