Skip to content

Commit e625e33

Browse files
author
mikeblome
committed
more edits per tech review
1 parent d355402 commit e625e33

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

docs/cpp-conformance-improvements-2017.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ For the complete list of conformance improvements up through Visual Studio 2015,
8282

8383
## Bug fixes
8484
### Copy-list-initialization
85-
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. As per N4594 13.3.1.7p1, 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.
85+
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. As per N4594 13.3.1.7p1, 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.
8686

8787
The following two examples compile in Visual Studio 2015 but not in Visual Studio 2017.
8888
```cpp
@@ -305,7 +305,7 @@ struct __declspec(dllexport) S1 { virtual void f() {} }; //C2201
305305
```
306306
307307
### Default initializers for value class members (C++/CLI)
308-
In Visual Studio 2015 and earlier, the compiler permitted (but ignored) a default member initializer for a member of a value class. Default initialization of a value class always zero-initializes the members; a default constructor is not permitted. In Visual Studio 2017, default member initializers raise a compiler error, as shown in this example:
308+
In Visual Studio 2015 and earlier, the compiler permitted (but ignored) a default member initializer for a member of a value class. Default initialization of a value class always zero-initializes the members; a default constructor is not permitted. In Visual Studio 2017, default member initializers raise a compiler error, as shown in this example:
309309
310310
```cpp
311311
value struct V
@@ -435,7 +435,7 @@ int main()
435435
To fix the error, remove the `#pragma managed` directive to mark the caller as native and avoid marshalling.
436436
437437
### Experimental API warning for WinRT
438-
WinRT APIs that are released for experimentation and feedback will be decorated with `Windows.Foundation.Metadata.ExperimentalAttribute`. In Visual Studio 2017 version 15.3, the compiler will produce warning C4698 when it encounters the attribute. A few APIs in previous versions of the Windows SDK have already been decorated with the attribute, and calls to these APIs will start triggering this compiler warning. Newer Windows SDKs will have the attribute removed from all shipped types, but if you are using an older SDK, you'll need to suppress these warnings for all calls to shipped types.
438+
WinRT APIs that are released for experimentation and feedback will be decorated with `Windows.Foundation.Metadata.ExperimentalAttribute`. In Visual Studio 2017 version 15.3, the compiler will produce warning C4698 when it encounters the attribute. A few APIs in previous versions of the Windows SDK have already been decorated with the attribute, and calls to these APIs will start triggering this compiler warning. Newer Windows SDKs will have the attribute removed from all shipped types, but if you are using an older SDK, you'll need to suppress these warnings for all calls to shipped types.
439439
The following code produces warning C4698: "'Windows::Storage::IApplicationDataStatics2::GetForUserAsync' is for evaluation purposes only and is subject to change or removal in future updates":
440440
```cpp
441441
Windows::Storage::IApplicationDataStatics2::GetForUserAsync() //C4698
@@ -490,7 +490,7 @@ void f()
490490
}
491491
```
492492
### Default arguments are not allowed on out of line definitions of member functions
493-
Default arguments are not allowed on out-of-line definitions of member functions in template classes. The compiler will issue a warning under /permissive, and a hard error under /permissive-.
493+
Default arguments are not allowed on out-of-line definitions of member functions in template classes The compiler will issue a warning under /permissive, and a hard error under /permissive-.
494494
495495
In previous versions of Visual Studio, the following ill-formed code could potentially cause a runtime crash. Visual Studio 2017 version 15.3 produces warning C5034: 'A<T>::f': an out-of-line definition of a member of a class template cannot have default arguments:
496496
```cpp
@@ -604,7 +604,7 @@ B<int>; // warning C4091 : '' : ignored on left of 'B<int>' when no variable is
604604
C; // warning C4091 : '' : ignored on left of 'C' when no variable is declared
605605
```
606606
607-
To remove the warnings, simply comment-out or remove the empty declarations. In cases where the un-named object is intended to have a side effect (such as RAII) it should be given a name.
607+
To remove the warnings, simply comment-out or remove the empty declarations. In cases where the un-named object is intended to have a side effect (such as RAII) it should be given a name.
608608
609609
The warning is excluded under /Wv:18 and is on by default under warning level W2.
610610

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ This release brings several improvements in optimization, code generation, tools
7575
* Minor basic_string _ITERATOR_DEBUG_LEVEL != 0 diagnostics improvements. Tripping an IDL check in string machinery will now report the specific behavior that caused the trip. For example, instead of "string iterator not dereferencable" you'll get "cannot dereference string iterator because it is out of range (e.g. an end iterator)".
7676
* Performance improvement: made basic_string::find(char) overloads only call traits::find once. Previously this was implemented as a general string search for a string of length 1.
7777
* Performance improvement: basic_string::operator== now checks the string's size before comparing the strings' contents.
78-
* Performance improvement: removed control coupling in basic_string which was difficult for the compiler optimizer to analyze. Resolves VSO# 262848 "<string>: reserve() does too much work". Note that for all short strings, calling reserve still has nonzero cost to do nothing.
78+
* Performance improvement: removed control coupling in basic_string which was difficult for the compiler optimizer to analyze. Resolves VSO# 262848 "\<string\>: reserve() does too much work". Note that for all short strings, calling reserve still has nonzero cost to do nothing.
7979
* We added \<any\>, \<string_view\>, apply(), make_from_tuple().
8080
* std::vector has been overhauled for correctness and performance: aliasing during insertion/emplacement is now correctly handled as required by the Standard, the strong exception guarantee is now provided when required by the Standard via move_if_noexcept() and other logic, and insertion/emplacement perform fewer element operations.
8181
* The C++ Standard Library now avoids dereferencing null fancy pointers.
@@ -105,20 +105,20 @@ Several additional C++17 features have been implemented. For more information, s
105105
* Even when dynamic RTTI has been disabled via /GR-, "static RTTI" (in the form of typeid(SomeType)) is still available and powers several Standard Library components. The Standard Library now supports disabling this too, via /D_HAS_STATIC_RTTI=0. *Note that this will disable std::any, std::function's target() and target_type(), and shared_ptr's get_deleter().*
106106

107107
##### Correctness Fixes
108-
* Standard Library containers now clamp their max_size() to numeric_limits<difference_type>::max() rather than size_type's max. This ensures that the result of distance() on iterators from that container is representable in the return type of distance().
109-
* Fixed missing specialization auto_ptr<void>.
108+
* Standard Library containers now clamp their max_size() to numeric_limits\<difference_type\>::max() rather than size_type's max. This ensures that the result of distance() on iterators from that container is representable in the return type of distance().
109+
* Fixed missing specialization auto_ptr\<void\>.
110110
* The meow_n() algorithms previously failed to compile if the length argument was not an integral type; they now attempt to convert non-integral lengths to the iterators' difference_type.
111-
* normal_distribution<float> no longer emits warnings inside the Standard Library about narrowing from double to float.
111+
* normal_distribution\<float\> no longer emits warnings inside the Standard Library about narrowing from double to float.
112112
* Fixed some basic_string operations which were comparing with npos instead of max_size() when checking for maximum size overflow.
113113
* condition_variable::wait_for(lock, relative_time, predicate) would wait for the entire relative time in the event of a spurious wake. Now, it will wait for only a single interval of the relative time.
114114
* future::get() now invalidates the future, as the standard requires.
115-
* iterator_traits<void *> used to be a hard error because it attempted to form void&; it now cleanly becomes an empty struct to allow use of iterator_traits in "is iterator" SFINAE conditions.
115+
* iterator_traits\<void \*\> used to be a hard error because it attempted to form void&; it now cleanly becomes an empty struct to allow use of iterator_traits in "is iterator" SFINAE conditions.
116116
* Some warnings reported by Clang -Wsystem-headers were fixed.
117117
* Also fixed "exception specification in declaration does not match previous declaration" reported by Clang -Wmicrosoft-exception-spec.
118118
* Also fixed mem-initializer-list ordering warnings reported by Clang and C1XX.
119119
* The unordered containers did not swap their hashers or predicates when the containers themselves were swapped. Now they do.
120120
* Many container swap operations are now marked noexcept (as our Standard Library never intends to throw an exception when detecting the non-propagate_on_container_swap non-equal-allocator undefined behavior condition).
121-
* Many vector<bool> operations are now marked noexcept.
121+
* Many vector\<bool\> operations are now marked noexcept.
122122
* The Standard Library will now enforce matching allocator value_types (in C++17 mode) with an opt-out escape hatch.
123123
* Fixed some conditions where self-range-insert into basic_strings would scramble the strings' contents. (Note: self-range-insert into vectors is still prohibited by the Standard.)
124124
* basic_string::shrink_to_fit() is no longer affected by the allocator's propagate_on_container_swap.
@@ -136,15 +136,15 @@ Several additional C++17 features have been implemented. For more information, s
136136
* Enabled the Named Return Value Optimization in system_category::message().
137137
* conjunction and disjunction now instantiate N + 1 types, instead of 2N + 2 types.
138138
* std::function no longer instantiates allocator support machinery for each type-erased callable, improving throughput and reducing .obj size in programs that pass many distinct lambdas to std::function.
139-
* allocator_traits<std::allocator> contains manually inlined std::allocator operations, reducing code size in code that interacts with std::allocator through allocator_traits only (i.e. most code).
140-
* The C++11 minimal allocator interface is now handled by the Standard Library calling allocator_traits directly, instead of wrapping the allocator in an internal class _Wrap_alloc. This reduces the code size generated for allocator support, improves the optimizer's ability to reason about Standard Library containers in some cases, and provides a better debugging experience (as now you see your allocator type, rather than _Wrap_alloc<your allocator type> in the debugger).
139+
* allocator_traits\<std::allocator\> contains manually inlined std::allocator operations, reducing code size in code that interacts with std::allocator through allocator_traits only (i.e. most code).
140+
* The C++11 minimal allocator interface is now handled by the Standard Library calling allocator_traits directly, instead of wrapping the allocator in an internal class _Wrap_alloc. This reduces the code size generated for allocator support, improves the optimizer's ability to reason about Standard Library containers in some cases, and provides a better debugging experience (as now you see your allocator type, rather than _Wrap_alloc\<your allocator type\> in the debugger).
141141
* Removed metaprogramming for customized allocator::reference, which allocators aren't actually allowed to customize. (Allocators can make containers use fancy pointers but not fancy references.)
142142
* The compiler front-end was taught to unwrap debug iterators in range-based for-loops, improving the performance of debug builds.
143143
* basic_string's internal shrink path for shrink_to_fit() and reserve() is no longer in the path of reallocating operations, reducing code size for all mutating members.
144144
* basic_string's internal grow path is no longer in the path of shrink_to_fit().
145145
* basic_string's mutating operations are now factored into non-allocating fast path and allocating slow path functions, making it more likely for the common no-reallocate case to be inlined into callers.
146146
* basic_string's mutating operations now construct reallocated buffers in the desired state rather than resizing in place. For example, inserting at the beginning of a string now moves the content after the insertion exactly once (either down or to the newly allocated buffer), instead of twice in the reallocating case (to the newly allocated buffer and then down).
147-
* Operations calling the C standard library in <string> now cache errno's address to remove repeated interaction with TLS.
147+
* Operations calling the C standard library in \<string\> now cache errno's address to remove repeated interaction with TLS.
148148
* Simplified is_pointer's implementation.
149149
* Finished changing function-based Expression SFINAE to struct/void_t-based.
150150
* Standard Library algorithms now avoid postincrementing iterators.
@@ -159,7 +159,7 @@ Several additional C++17 features have been implemented. For more information, s
159159
* Changed static_assert(false, "message") to #error message. This improves compiler diagnostics because #error immediately stops compilation.
160160
* The Standard Library no longer marks functions as __declspec(dllimport). Modern linker technology no longer requires this.
161161
* Extracted SFINAE to default template arguments, which reduces clutter compared to return types and function argument types.
162-
* Debug checks in <random> now use the Standard Library's usual machinery, instead of the internal function _Rng_abort() which called fputs() to stderr. This function's implementation is being retained for binary compatibility, but has been removed in the next binary-incompatible version of the Standard Library.
162+
* Debug checks in \<random\> now use the Standard Library's usual machinery, instead of the internal function _Rng_abort() which called fputs() to stderr. This function's implementation is being retained for binary compatibility, but has been removed in the next binary-incompatible version of the Standard Library.
163163

164164
### Open source library support
165165
Vcpkg is an open-source command line tool that greatly simplifies the process of acquiring and building open source C++ static libs and DLLS in Visual Studio. For more information, see [vcpkg: A package manager for C++](vcpkg.md).

0 commit comments

Comments
 (0)