Skip to content

Commit 88de1dd

Browse files
authored
Merge pull request MicrosoftDocs#65 from Microsoft/cr-fix-permissive
Cr fix permissive
2 parents 94d29b8 + 345ffb3 commit 88de1dd

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

docs/build/reference/permissive-standards-conformance.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ translation.priority.ht:
3838
- "zh-tw"
3939
---
4040
# /permissive- (Standards conformance)
41-
Specify strict standards conformance mode to the compiler. Use this option to help you identify and fix conformance issues in your code, to make it both more correct and more portable.
41+
Specify standards conformance mode to the compiler. Use this option to help you identify and fix conformance issues in your code, to make it both more correct and more portable.
4242

4343
## Syntax
4444
```
@@ -47,20 +47,20 @@ Specify strict standards conformance mode to the compiler. Use this option to he
4747

4848
## Remarks
4949

50-
You can use the **/permissive-** compiler option to specify strict standards-conformant compiler behavior. This option disables non-standard language extensions and permissive behaviors, and sets the [/Zc](../../build/reference/zc-conformance.md) compiler options for strict conformance. In the IDE, this option also makes the IntelliSense engine underline non-conformant code.
50+
You can use the **/permissive-** compiler option to specify standards-conforming compiler behavior. This option disables permissive behaviors, and sets the [/Zc](../../build/reference/zc-conformance.md) compiler options for strict conformance. In the IDE, this option also makes the IntelliSense engine underline non-conforming code.
5151

5252
By default, the **/permissive-** option is not set. When the option is set, the compiler generates diagnostic errors or warnings when non-standard language constructs are detected in your code, including some common bugs in pre-C++11 code.
5353

54-
The **/permissive-** option sets the [/Zc:strictStrings](../../build/reference/zc-conformance.md) and [/Zc:rvalueCast](../../build/reference/zc-conformance.md) options to conformant behavior. They default to non-conforming behavior. You can pass specific /Zc options after **/permissive-** on the command line to override this behavior if needed.
54+
The **/permissive-** option sets the [/Zc:strictStrings](../../build/reference/zc-conformance.md) and [/Zc:rvalueCast](../../build/reference/zc-conformance.md) options to conforming behavior. They default to non-conforming behavior. You can pass specific **/Zc** options after **/permissive-** on the command line to override this behavior.
5555

5656
Environment-specific extensions and language areas that the standard leaves up to the implementation are not affected by **/permissive-**. For example, the Microsoft-specific `__declspec`, calling convention and structured exception handling keywords, and compiler-specific pragma directives or attributes are not flagged by the compiler in **/permissive-** mode.
5757

58-
The **/permissive-** option uses the conformance support in the current compiler version to determine which language constructs are non-conformant. The option does not determine if your code is conformant to a specific version of the C++ standard. To restrict the compiler support to more closely match the C++14 standard, use the [/std:c++14](../../build/reference/std-specify-language-standard-version.md) option.
58+
The **/permissive-** option uses the conformance support in the current compiler version to determine which language constructs are non-conforming. The option does not determine if your code conforms to a specific version of the C++ standard. To enable all implemented compiler support for the latest draft standard, use the [/std:latest](../../build/reference/std-specify-language-standard-version.md) option. To restrict the compiler support to more closely match the C++14 standard, use the [/std:c++14](../../build/reference/std-specify-language-standard-version.md) option, which is the default.
5959

60-
Not all C++11, C++14, or C++17 standard conformant code is supported by the Visual C++ compiler in Visual Studio 2017 RC. The **/permissive-** option may not detect issues regarding two-phase name lookup, binding a non-const reference to a temporary, treating copy init as direct init, allowing multiple user-defined conversions in initialization, or alternative tokens for logical operators, and other non-supported conformance areas. For more information about conformance issues in Visual C++, see [Nonstandard Behavior](../../cpp/nonstandard-behavior.md).
60+
Not all C++11, C++14, or draft C++17 standards-conforming code is supported by the Visual C++ compiler in Visual Studio 2017 RC. The **/permissive-** option may not detect issues regarding two-phase name lookup, binding a non-const reference to a temporary, treating copy init as direct init, allowing multiple user-defined conversions in initialization, or alternative tokens for logical operators, and other non-supported conformance areas. For more information about conformance issues in Visual C++, see [Nonstandard Behavior](../../cpp/nonstandard-behavior.md).
6161

6262
### How to fix your code
63-
Here are some examples of code that is detected as non-conformant when you use **/permissive-**, along with suggested ways to fix the issues.
63+
Here are some examples of code that is detected as non-conforming when you use **/permissive-**, along with suggested ways to fix the issues.
6464

6565
#### Use default as an identifier in native code
6666
```cpp
@@ -110,8 +110,8 @@ union U
110110
{
111111
U()
112112
: i(1), j(1) // error C3442: Initializing multiple members of
113-
// union: 'U::i' and 'U::j'
114-
// Remove all but one of the initializations to fix
113+
// union: 'U::i' and 'U::j'.
114+
// Remove all but one of the initializations to fix.
115115
{}
116116
int i;
117117
int j;
@@ -128,7 +128,7 @@ struct S {
128128
// void f(S *); // This declaration makes the hidden friend visible
129129

130130
using type = void (*)(S *);
131-
type p = &f; // error C2065: 'f': undeclared identifier
131+
type p = &f; // error C2065: 'f': undeclared identifier.
132132
```
133133
```cpp
134134
// Example 2

0 commit comments

Comments
 (0)