Skip to content

Commit d880c0b

Browse files
authored
Merge branch 'master' into kraigb-python-tutorials
2 parents 69313cf + a19a063 commit d880c0b

File tree

201 files changed

+7084
-5491
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

201 files changed

+7084
-5491
lines changed

.openpublishing.redirection.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2167,6 +2167,36 @@
21672167
"source_path": "docs/ide/quickstart-visual-basic-winforms.md",
21682168
"redirect_url": "/visualstudio/ide/create-a-visual-basic-winform-in-visual-studio",
21692169
"redirect_document_id": false
2170+
},
2171+
{
2172+
"source_path": "subscriptions/buy-vs-subscriptions.md",
2173+
"redirect_url": "http://www.visualstudio.com/vs/pricing/",
2174+
"redirect_document_id": false
2175+
},
2176+
{
2177+
"source_path": "subscriptions/compare-subscriptions.md",
2178+
"redirect_url": "http://www.visualstudio.com/vs/pricing/",
2179+
"redirect_document_id": false
2180+
},
2181+
{
2182+
"source_path": "subscriptions/vscloud-first-purchase.md",
2183+
"redirect_url": "/visualstudio/subscriptions/vscloud-overview",
2184+
"redirect_document_id": false
2185+
},
2186+
{
2187+
"source_path": "subscriptions/vscloud-renewals.md",
2188+
"redirect_url": "/visualstudio/subscriptions/vscloud-overview",
2189+
"redirect_document_id": false
2190+
},
2191+
{
2192+
"source_path": "subscriptions/vscloud-buy-more.md",
2193+
"redirect_url": "/visualstudio/subscriptions/vscloud-overview",
2194+
"redirect_document_id": false
2195+
},
2196+
{
2197+
"source_path": "subscriptions/vscloud-cancel.md",
2198+
"redirect_url": "/visualstudio/subscriptions/vscloud-overview",
2199+
"redirect_document_id": false
21702200
}
21712201
]
21722202
}

docs/TOC.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# [Visual Studio Documentation](ide/index.md)
22
# [Overview](ide/visual-studio-ide.md)
3-
## [What's New](ide/whats-new-in-visual-studio.md)
43
# Installation
54
## [Install Visual Studio](install/install-visual-studio.md)
65
## [Sign in to Visual Studio](ide/signing-in-to-visual-studio.md)
@@ -449,6 +448,17 @@
449448
### [Install Dotfuscator CE](ide/dotfuscator/install.md)
450449
### [Upgrade Dotfuscator CE](ide/dotfuscator/upgrades.md)
451450
# Resources
451+
## [What's New](ide/whats-new-in-visual-studio.md)
452+
## Release notes & system requirements
453+
### [Current release notes](/visualstudio/releasenotes/vs2017-relnotes?context=visualstudio/default)
454+
### [Preview release notes](/visualstudio/releasenotes/vs2017-preview-relnotes?context=visualstudio/default)
455+
### [Release notes history](/visualstudio/releasenotes/vs2017-relnotes-history?context=visualstudio/default)
456+
### [Release rhythm](/visualstudio/productinfo/vs2017-release-rhythm?context=visualstudio/default)
457+
### [System requirements](/visualstudio/productinfo/vs2017-system-requirements-vs?context=visualstudio/default)
458+
### [Platform compatibility](/visualstudio/productinfo/vs2017-compatibility-vs?context=visualstudio/default)
459+
### [Licensing](https://www.visualstudio.com/license-terms/)
460+
### [Distributable code](/visualstudio/productinfo/2017-redistribution-vs?context=visualstudio/default)
461+
### [Support lifecycle and servicing](/visualstudio/productinfo/vs-servicing-vs?context=visualstudio/default)
452462
## [How to Report a Problem with Visual Studio](ide/how-to-report-a-problem-with-visual-studio-2017.md)
453463
## [Resources for Troubleshooting IDE Errors](ide/reference/resources-for-troubleshooting-integrated-development-environment-errors.md)
454464
## [Talk to Us](ide/talk-to-us.md)

docs/code-quality/TOC.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,15 +349,39 @@
349349
### [C26441](C26441.md)
350350
### [C26443](c26443.md)
351351
### [C26444](c26444.md)
352+
### [C26445](c26445.md)
353+
### [C26446](c26446.md)
354+
### [C26447](c26447.md)
355+
### [C26448](c26448.md)
356+
### [C26449](c26449.md)
352357
### [C26450](C26450.md)
353358
### [C26451](C26451.md)
354359
### [C26452](C26452.md)
355360
### [C26453](C26453.md)
356361
### [C26454](C26454.md)
362+
### [C26460](C26460.md)
363+
### [C26461](C26461.md)
364+
### [C26462](C26462.md)
365+
### [C26463](C26463.md)
366+
### [C26464](C26464.md)
367+
### [C26465](C26465.md)
368+
### [C26466](C26466.md)
369+
### [C26471](C26471.md)
357370
### [C26472](C26472.md)
358371
### [C26473](C26473.md)
359372
### [C26474](C26474.md)
360373
### [C26475](C26475.md)
374+
### [C26482](C26482.md)
375+
### [C26483](C26483.md)
376+
### [C26490](C26490.md)
377+
### [C26491](C26491.md)
378+
### [C26492](C26492.md)
379+
### [C26493](C26493.md)
380+
### [C26494](C26494.md)
381+
### [C26495](C26495.md)
382+
### [C26496](C26496.md)
383+
### [C26497](C26497.md)
384+
### [C26498](C26498.md)
361385
## [Code Analysis for C/C++ Warnings](code-analysis-for-c-cpp-warnings.md)
362386
### [C1250](c1250.md)
363387
### [C1251](c1251.md)

docs/code-quality/c26445.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
title: "C26445 | Microsoft Docs"
3+
ms.custom: ""
4+
ms.date: "03/22/2018"
5+
ms.reviewer: ""
6+
ms.suite: ""
7+
ms.technology:
8+
- "vs-ide-code-analysis"
9+
ms.tgt_pltfrm: ""
10+
ms.topic: "article"
11+
f1_keywords:
12+
- "C26445"
13+
helpviewer_keywords:
14+
- "C26445"
15+
author: mikeblome
16+
ms.author: mblome
17+
manager: ghogen
18+
ms.workload:
19+
- "multiple"
20+
---
21+
# C26445 NO_SPAN_REF
22+
A reference to `gsl::span` or `std::string_view` may be an indication of a lifetime issue.
23+
C++ Core Guidelines: [GSL.view: Views](https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#gslview-views)
24+
25+
The intention of this rule is to catch subtle lifetime issues that may occur in code which has been migrated from standard containers to new span and view types. Such types can be considered as “references to buffers.” Using a reference to a span or view creates an additional layer of indirection. Such indirection is often unnecessary and can be confusing for maintainers. In addition, spans are cheap to copy and can be returned by value from function calls. Obviously, such call results should never be referenced.
26+
27+
## Remarks
28+
29+
- The rule detects references to gsl::span<>, gsl::basic_string_span<>, and std::basic_string_view<> (including aliases to instantiations).
30+
- Currently warnings are emitted only on declarations and return statements. This may be extended in future to also flag function parameters.
31+
- The implementation of this rule is very lightweight doesn’t attempt to trace actual lifetimes. Using of references may still make sense in some scenarios. In such cases, false positives can safely be suppressed.
32+
33+
## Example: Reference to a temporary
34+
35+
```cpp
36+
// Old API - uses string reference to avoid data copy.
37+
const std::string& get_working_directory() noexcept;
38+
39+
// New API – after migration to C++17 it uses string view.
40+
std::string_view get_working_directory() noexcept;
41+
42+
// ...
43+
// Client code which places an explicit reference in a declaration with auto specifier.
44+
const auto &wd = get_working_directory(); // C26445 after API update.
45+
```
46+

docs/code-quality/c26446.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
title: "C26446 | Microsoft Docs"
3+
ms.custom: ""
4+
ms.date: "03/22/2018"
5+
ms.reviewer: ""
6+
ms.suite: ""
7+
ms.technology:
8+
- "vs-ide-code-analysis"
9+
ms.tgt_pltfrm: ""
10+
ms.topic: "article"
11+
f1_keywords:
12+
- "C26446"
13+
helpviewer_keywords:
14+
- "C26446"
15+
author: mikeblome
16+
ms.author: mblome
17+
manager: ghogen
18+
ms.workload:
19+
- "multiple"
20+
---
21+
# C26446 USE_GSL_AT
22+
23+
Prefer to use `gsl::at()` instead of unchecked subscript operator.
24+
25+
C++ Core Guidelines: [Bounds.4: Don't use standard-library functions and types that are not bounds-checked](https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#probounds-bounds-safety-profile).
26+
27+
The Bounds profile of the C++ Core Guidelines tries to eliminate unsafe manipulations of memory by avoiding the use of raw pointers and unchecked operations. One way to perform uniform range-checked access to buffers is to use the `gsl::at()` utility from the Guidelines Support Library. It is also a good practice to rely on standard implementations of `at()` available in STL containers.
28+
29+
This rule helps to find places where potentially unchecked access is performed via calls to operator\[](). In most cases such calls can be easily replaced by `gsl::at()`.
30+
31+
32+
- Access to arrays with known size is flagged when non-constant index is used in a subscript operator. Constant indices are handled by [C26483 STATIC_INDEX_OUT_OF_RANGE](c26483.md).
33+
- The logic to warn on overloaded operator[] calls is more complex:
34+
- If index is non-integral, the call is ignored. This also handles indexing in standard maps since parameters in such operators are passed by reference.
35+
- If the operator is marked as non-throwing (by using **noexcept**, **throw()**, or **__declspec(nothrow)**), the call is flagged. It is assumed that if the subscript operator never throws exceptions it either doesn’t perform range checks or these checks are obscure.
36+
- If the operator is not marked as non-throwing, it may be flagged if it comes from an STL container that also defines a conventional `at()` member function (such functions are detected by simple name matching).
37+
- The rule doesn’t warn on calls to standard `at()` methods. These methods are safe and replacing them with `gsl::at()` would not bring much value.
38+
- Indexing into `std::basic_string_view<>` is not safe, so a warning is issued. The standard string view can be replaced by `gsl::basic_string_span<>`, which is always bounds-checked.
39+
- The implementation doesn’t consider range checks that user code may have somewhere in loops or branches. Accuracy here is traded for performance. In general, explicit range checks can often be replaced with more reliable iterators or more concise enhanced for-loops.
40+

docs/code-quality/c26447.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
title: "C26447 | Microsoft Docs"
3+
ms.custom: ""
4+
ms.date: "03/22/2018"
5+
ms.reviewer: ""
6+
ms.suite: ""
7+
ms.technology:
8+
- "vs-ide-code-analysis"
9+
ms.tgt_pltfrm: ""
10+
ms.topic: "article"
11+
f1_keywords:
12+
- "C26447"
13+
helpviewer_keywords:
14+
- "C26447"
15+
author: mikeblome
16+
ms.author: mblome
17+
manager: ghogen
18+
ms.workload:
19+
- "multiple"
20+
---
21+
# C26447 DONT_THROW_IN_NOEXCEPT
22+
23+
The function is declared **noexcept** but calls a function that may throw exceptions.
24+
25+
C++ Core Guidelines:
26+
[F.6: If your function may not throw, declare it noexcept](https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#f6-if-your-function-may-not-throw-declare-it-noexcept).
27+
28+
This rule amends another rule, [C26440 DECLARE_NOEXCEPT](c26440.md), which tries to find functions that are good candidates to be marked as **noexcept**. In this case, the idea is that once some function is marked as **noexcept**, it must keep its contract by not invoking other code that may throw exceptions.
29+
30+
- The Microsoft C++ compiler already handles straightforward violations like **throw** statements in the function body (see [C4297](/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4297)).
31+
- The rule focuses only on function calls. It flags targets that are not **constexpr** and that can potentially throw exceptions; in other words they are not marked explicitly as non-throwing by using **noexcept**, **__declspec(nothrow)**, **throw()**.
32+
- The compiler-generated target functions are skipped to reduce noise since exception specifications are not always provided by the compiler.
33+
- The checker also skips special kinds of target functions that are expected to be implemented as **noexcept**; this rule is enforced by [C26439 SPECIAL_NOEXCEPT](c26439.md).
34+

docs/code-quality/c26448.md

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
---
2+
title: "C26448 | Microsoft Docs"
3+
ms.custom: ""
4+
ms.date: "03/22/2018"
5+
ms.reviewer: ""
6+
ms.suite: ""
7+
ms.technology:
8+
- "vs-ide-code-analysis"
9+
ms.tgt_pltfrm: ""
10+
ms.topic: "article"
11+
f1_keywords:
12+
- "C26448"
13+
helpviewer_keywords:
14+
- "C26448"
15+
author: mikeblome
16+
ms.author: mblome
17+
manager: ghogen
18+
ms.workload:
19+
- "multiple"
20+
---
21+
# C26448 USE_GSL_FINALLY
22+
23+
Consider using `gsl::finally` if final action is intended.
24+
25+
C++ Core Guidelines: [GSL.util: Utilities](https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#SS-utilities)
26+
27+
The Guidelines Support Library provides a convenient utility to implement the *final action* concept. Since the C++ language doesn't support **try-finally** constructs, it became common to implement custom cleanup types that would invoke arbitrary actions on destruction. The `gsl::finally` utility is implemented in this way and provides a more uniform way to perform final actions across a code base.
28+
29+
There are also cases where final actions are performed in an old-fashioned C-style way by using **goto** statements (which is generally discouraged by [C26438 NO_GOTO](c26438.md)). It is hard to detect the exact intention in code that heavily uses **goto**, but some heuristics can help to find better candidates for cleanup.
30+
31+
## Remarks
32+
33+
- This rule is very lightweight and uses label names to guess about opportunities to use final action objects.
34+
- Label names that can raise a warning contain words like "end", "final", "clean", and so on.
35+
- Warnings appear at the **goto** statements. You may see verbose output on some occasions, but this may help in prioritizing code depending on its complexity.
36+
- This rule always goes in pair with [C26438 NO_GOTO](c26438.md). Depending on the priorities, one of these can be disabled.
37+
38+
## Example: Cleanup with multiple goto statements
39+
40+
```cpp
41+
void poll(connection_info info)
42+
{
43+
connection c = {};
44+
if (!c.open(info))
45+
return;
46+
47+
while (c.wait())
48+
{
49+
connection::header h{};
50+
connection::signature s{};
51+
if (!c.read_header(h))
52+
goto end; // C26448 and C26438
53+
if (!c.read_signature(s))
54+
goto end; // C26448 and C26438
55+
// ...
56+
}
57+
58+
end:
59+
c.close();
60+
}
61+
```
62+
63+
## Example: Cleanup with multiple goto statements replaced by gsl::finally
64+
65+
```cpp
66+
void poll(connection_info info)
67+
{
68+
connection c = {};
69+
if (!c.open(info))
70+
return;
71+
72+
auto end = gsl::finally([&c] { c.close(); });
73+
while (c.wait())
74+
{
75+
connection::header h{};
76+
connection::signature s{};
77+
if (!c.read_header(h))
78+
return;
79+
if (!c.read_signature(s))
80+
return;
81+
// ...
82+
}
83+
}
84+
```
85+

docs/code-quality/c26449.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
---
2+
title: "C26449 | Microsoft Docs"
3+
ms.custom: ""
4+
ms.date: "03/22/2018"
5+
ms.reviewer: ""
6+
ms.suite: ""
7+
ms.technology:
8+
- "vs-ide-code-analysis"
9+
ms.tgt_pltfrm: ""
10+
ms.topic: "article"
11+
f1_keywords:
12+
- "C26449"
13+
helpviewer_keywords:
14+
- "C26449"
15+
author: mikeblome
16+
ms.author: mblome
17+
manager: ghogen
18+
ms.workload:
19+
- "multiple"
20+
---
21+
# C26449 NO_SPAN_FROM_TEMPORARY
22+
23+
`gsl::span` or `std::string_view` created from a temporary will be invalid when the temporary is invalidated.
24+
25+
C++ Core Guidelines: [GSL.view: Views](https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#gslview-views).
26+
27+
Spans and views are convenient and lightweight types that allow to reference memory buffers. But they must be used carefully: while their interface looks similar to standard containers, their behavior is more like the behavior of pointers and references. They do not own data and must never be constructed from temporary buffers. This check focuses on cases where source data is temporary, while span or view is not. There is another check which handles slightly different scenario involving span references: [C26445 NO_SPAN_REF](c26445.md). Both rules can help to avoid subtle but dangerous mistakes made when legacy code gets modernized and adopts spans or views.
28+
29+
## Remarks
30+
31+
- This rule warns on places where constructors get invoked for spans or views and the source data buffer belongs to a temporary object created in the same statement. This includes:
32+
- implicit conversions in return statements;
33+
- implicit conversions in ternary operators;
34+
- explicit conversions in `static_cast` expressions;
35+
- function calls that return containers by value.
36+
- Temporaries created for function call arguments are not flagged. It is safe to pass spans from such temporaries if target functions don’t retain data pointers in external variables.
37+
- If spans or views are themselves temporaries, the rule skips them.
38+
- Data tracking in the checker has certain limitations; therefore complex scenarios involving multiple or obscure reassignments may not be handled.
39+
40+
## Example: Subtle difference in result types
41+
42+
```cpp
43+
// Returns a predefined collection. Keeps data alive.
44+
gsl::span<const sequence_item> get_seed_sequence() noexcept;
45+
46+
// Returns a generated collection. Doesn’t own new data.
47+
const std::vector<sequence_item> get_next_sequence(gsl::span<const sequence_item>);
48+
49+
void run_batch()
50+
{
51+
auto sequence = get_seed_sequence();
52+
while (send(sequence))
53+
{
54+
sequence = get_next_sequence(sequence); // C26449
55+
// ...
56+
}
57+
}
58+
```

docs/code-quality/c26460.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
title: "C26460 | Microsoft Docs"
3+
ms.custom: ""
4+
ms.date: "03/22/2018"
5+
ms.reviewer: ""
6+
ms.suite: ""
7+
ms.technology:
8+
- "vs-ide-code-analysis"
9+
ms.tgt_pltfrm: ""
10+
ms.topic: "article"
11+
f1_keywords:
12+
- "C26460"
13+
helpviewer_keywords:
14+
- "C26460"
15+
author: mikeblome
16+
ms.author: mblome
17+
manager: ghogen
18+
ms.workload:
19+
- "multiple"
20+
---
21+
# C26460 USE_CONST_REFERENCE_ARGUMENTS
22+
23+
The reference argument '%argument%' for function '%function%' can be marked as `const`. See [C++ Core Guidelines con.3](https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#Rconst-ref).

0 commit comments

Comments
 (0)