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/build/reference/permissive-standards-conformance.md
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,7 +38,7 @@ translation.priority.ht:
38
38
- "zh-tw"
39
39
---
40
40
# /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.
42
42
43
43
## Syntax
44
44
```
@@ -47,20 +47,20 @@ Specify strict standards conformance mode to the compiler. Use this option to he
47
47
48
48
## Remarks
49
49
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.
51
51
52
52
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.
53
53
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.
55
55
56
56
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.
57
57
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.
59
59
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).
61
61
62
62
### 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.
64
64
65
65
#### Use default as an identifier in native code
66
66
```cpp
@@ -110,8 +110,8 @@ union U
110
110
{
111
111
U()
112
112
: 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.
115
115
{}
116
116
int i;
117
117
int j;
@@ -128,7 +128,7 @@ struct S {
128
128
// void f(S *); // This declaration makes the hidden friend visible
129
129
130
130
using type = void (*)(S *);
131
-
type p = &f; // error C2065: 'f': undeclared identifier
131
+
type p = &f; // error C2065: 'f': undeclared identifier.
0 commit comments