Skip to content

Commit 14d6ae0

Browse files
authored
Merge pull request MicrosoftDocs#3354 from MicrosoftDocs/master
1/11/2020 AM Publish
2 parents e71b8da + 110ac5c commit 14d6ae0

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed

docs/build/reference/zc-conformance.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ These are the **`/Zc`** compiler options:
2323
|--|--|
2424
| [`/Zc:alignedNew`](zc-alignednew.md) | Enable C++17 over-aligned dynamic allocation (on by default in C++17). |
2525
| [`/Zc:auto`](zc-auto-deduce-variable-type.md) | Enforce the new Standard C++ meaning for **`auto`** (on by default). |
26-
| [`/Zc__cplusplus`](zc-cplusplus.md) | Enable the `__cplusplus` macro to report the supported standard (off by default). |
26+
| [`/Zc:__cplusplus`](zc-cplusplus.md) | Enable the `__cplusplus` macro to report the supported standard (off by default). |
2727
| [`/Zc:externConstexpr`](zc-externconstexpr.md) | Enable external linkage for **`constexpr`** variables (off by default). |
2828
| [`/Zc:forScope`](zc-forscope-force-conformance-in-for-loop-scope.md) | Enforce Standard C++ **`for`** scoping rules (on by default). |
29-
| [`/ZcimplicitNoexcept`](zc-implicitnoexcept-implicit-exception-specifiers.md) | Enable implicit **`noexcept`** on required functions (on by default). |
29+
| [`/Zc:implicitNoexcept`](zc-implicitnoexcept-implicit-exception-specifiers.md) | Enable implicit **`noexcept`** on required functions (on by default). |
3030
| [`/Zc:inline`](zc-inline-remove-unreferenced-comdat.md) | Remove unreferenced function or data if it is COMDAT or has internal linkage only (off by default). |
3131
| [`/Zc:noexceptTypes`](zc-noexcepttypes.md) | Enforce C++17 **`noexcept`** rules (on by default in C++17 or later). |
3232
| [`/Zc:preprocessor`](zc-preprocessor.md) | Use the new conforming preprocessor (off by default, except in C11/C17). |

docs/build/reference/zp-struct-member-alignment.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
description: "Learn more about: /Zp (Struct Member Alignment)"
33
title: "/Zp (Struct Member Alignment)"
4-
ms.date: "04/04/2019"
4+
ms.date: "01/08/2021"
55
f1_keywords: ["/zp", "VC.Project.VCCLCompilerTool.StructMemberAlignment", "VC.Project.VCCLWCECompilerTool.StructMemberAlignment"]
66
helpviewer_keywords: ["Struct Member Alignment compiler option", "Zp compiler option", "/Zp compiler option [C++]", "-Zp compiler option [C++]"]
77
ms.assetid: 5242f656-ed9b-48a3-bc73-cfcf3ed2520f
@@ -31,9 +31,9 @@ The available packing values are described in the following table:
3131
Don't use this option unless you have specific alignment requirements.
3232

3333
> [!WARNING]
34-
> C++ headers in the Windows SDK set and assume **`/Zp8`** packing internally. Memory corruption may occur if the **`/Zp`** setting is changed inside the Windows SDK headers. The headers aren't affected by any **`/Zp`** option you set on the command line.
34+
> The C/C++ headers in the Windows SDK assume **`/Zp8`** packing internally. Don't change the setting from the default when you include the Windows SDK headers, either by using **`/Zp`** on the command line or by using `#pragma pack`. Otherwise, your application may cause memory corruption at runtime.
3535
36-
You can also use [`pack`](../../preprocessor/pack.md) to control structure packing. For more information about alignment, see:
36+
You can also use the [`pack` pragma](../../preprocessor/pack.md) to control structure packing. For more information about alignment, see:
3737

3838
- [`align`](../../cpp/align-cpp.md)
3939

docs/cpp/auto-cpp.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,16 @@ Conversion cases in which you might not want to use **`auto`**:
4141

4242
To use the **`auto`** keyword, use it instead of a type to declare a variable, and specify an initialization expression. In addition, you can modify the **`auto`** keyword by using specifiers and declarators such as **`const`**, **`volatile`**, pointer (**`*`**), reference (**`&`**), and rvalue reference (**`&&`**). The compiler evaluates the initialization expression and then uses that information to deduce the type of the variable.
4343

44-
The initialization expression can be an assignment (equal-sign syntax), a direct initialization (function-style syntax), an [`operator new`](new-operator-cpp.md) expression, or the initialization expression can be the *for-range-declaration* parameter in a [Range-based `for` Statement (C++)](../cpp/range-based-for-statement-cpp.md) statement. For more information, see [Initializers](../cpp/initializers.md) and the code examples later in this document.
44+
The **`auto`** initialization expression can take several forms:
45+
46+
- Universal initialization syntax, such as `auto a { 42 };`.
47+
- Assignment syntax, such as `auto b = 0;`.
48+
- Universal assignment syntax, which combines the two previous forms, such as `auto c = { 3.14156 };`.
49+
- Direct initialization, or constructor-style syntax, such as `auto d( 1.41421f );`.
50+
51+
For more information, see [Initializers](../cpp/initializers.md) and the code examples later in this document.
52+
53+
When **`auto`** is used to declare the loop parameter in a range-based **`for`** statement, it uses a different initialization syntax, for example `for (auto& i : iterable) do_action(i);`. For more information, see [Range-based `for` Statement (C++)](../cpp/range-based-for-statement-cpp.md).
4554

4655
The **`auto`** keyword is a placeholder for a type, but it is not itself a type. Therefore, the **`auto`** keyword cannot be used in casts or operators such as [`sizeof`](../cpp/sizeof-operator.md) and (for C++/CLI) [`typeid`](../extensions/typeid-cpp-component-extensions.md).
4756

0 commit comments

Comments
 (0)