Skip to content

Commit 8925559

Browse files
authored
Replace term "sample" with "example" for error references in range [C2431, C2460]
1 parent c784665 commit 8925559

20 files changed

+29
-29
lines changed

docs/error-messages/compiler-errors-1/compiler-error-c2431.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ The ESP register is scaled or used as both index and base register. The SIB enco
1616

1717
## Example
1818

19-
The following sample generates C2431:
19+
The following example generates C2431:
2020

2121
```cpp
2222
// C2431.cpp

docs/error-messages/compiler-errors-1/compiler-error-c2432.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ A 16-bit register is used as an index or base register. The compiler does not su
1616

1717
## Example
1818

19-
The following sample generates C2432:
19+
The following example generates C2432:
2020

2121
```cpp
2222
// C2432.cpp

docs/error-messages/compiler-errors-1/compiler-error-c2434.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ It is not possible to dynamically initialize a per-process variable under **/clr
1818

1919
## Example
2020

21-
The following sample generates C2434. To fix this issue, use constants to initialize `process` variables.
21+
The following example generates C2434. To fix this issue, use constants to initialize `process` variables.
2222

2323
```cpp
2424
// C2434.cpp

docs/error-messages/compiler-errors-1/compiler-error-c2435.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ For more information, see [appdomain](../../cpp/appdomain.md) and [process](../.
2020

2121
## Example
2222

23-
The following sample generates C2435:
23+
The following example generates C2435:
2424

2525
```cpp
2626
// C2435.cpp

docs/error-messages/compiler-errors-1/compiler-error-c2436.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Member functions or local classes in the constructor initializer list cannot be
1616

1717
## Example
1818

19-
The following sample generates C2436:
19+
The following example generates C2436:
2020

2121
```cpp
2222
// C2436.cpp

docs/error-messages/compiler-errors-1/compiler-error-c2437.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ An object can be initialized only once.
1616

1717
## Example
1818

19-
The following sample generates C2437:
19+
The following example generates C2437:
2020

2121
```cpp
2222
// C2437.cpp

docs/error-messages/compiler-errors-1/compiler-error-c2438.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ A constructor is used to initialize a static member of a class. Static members m
1616

1717
## Example
1818

19-
The following sample generates C2438:
19+
The following example generates C2438:
2020

2121
```cpp
2222
// C2438.cpp

docs/error-messages/compiler-errors-1/compiler-error-c2440.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ The compiler generates C2440 when it can't convert from one type to another, eit
2121

2222
### C++ string literals are `const`
2323

24-
C2440 can be caused if you attempt to initialize a non-const `char*` (or `wchar_t*`) by using a string literal in C++ code, when the compiler conformance option [`/Zc:strictStrings`](../../build/reference/zc-strictstrings-disable-string-literal-type-conversion.md) is set. In C, the type of a string literal is array of **`char`**, but in C++, it's array of `const char`. This sample generates C2440:
24+
C2440 can be caused if you attempt to initialize a non-const `char*` (or `wchar_t*`) by using a string literal in C++ code, when the compiler conformance option [`/Zc:strictStrings`](../../build/reference/zc-strictstrings-disable-string-literal-type-conversion.md) is set. In C, the type of a string literal is array of **`char`**, but in C++, it's array of `const char`. This example generates C2440:
2525

2626
```cpp
2727
// C2440s.cpp
@@ -40,7 +40,7 @@ int main() {
4040

4141
### C++20 `u8` literals are `const char8_t`
4242

43-
In C++20 or under [`/Zc:char8_t`](../../build/reference/zc-char8-t.md), a UTF-8 literal character or string (such as `u8'a'` or `u8"String"`) is of type `const char8_t` or `const char8_t[N]`, respectively. This sample shows how compiler behavior changes between C++17 and C++20:
43+
In C++20 or under [`/Zc:char8_t`](../../build/reference/zc-char8-t.md), a UTF-8 literal character or string (such as `u8'a'` or `u8"String"`) is of type `const char8_t` or `const char8_t[N]`, respectively. This example shows how compiler behavior changes between C++17 and C++20:
4444

4545
```cpp
4646
// C2440u8.cpp
@@ -60,7 +60,7 @@ int main() {
6060

6161
### Pointer to member
6262

63-
You may see C2440 if you attempt to convert a pointer to member to `void*`. The next sample generates C2440:
63+
You may see C2440 if you attempt to convert a pointer to member to `void*`. The next example generates C2440:
6464

6565
```cpp
6666
// C2440.cpp
@@ -83,7 +83,7 @@ public:
8383
8484
### Cast of undefined type
8585
86-
The compiler emits C2440 if you attempt to cast from a type that's only forward declared but not defined. This sample generates C2440:
86+
The compiler emits C2440 if you attempt to cast from a type that's only forward declared but not defined. This example generates C2440:
8787
8888
```cpp
8989
// c2440a.cpp
@@ -98,7 +98,7 @@ Base * func(Derived * d) {
9898

9999
### Incompatible calling convention
100100

101-
The C2440 errors on lines 15 and 16 of the next sample are qualified with the `Incompatible calling conventions for UDT return value` message. A *UDT* is a user-defined type, such as a class, struct, or union. These kinds of incompatibility errors are caused when the calling convention of a UDT specified in the return type of a forward declaration conflicts with the actual calling convention of the UDT and when a function pointer is involved.
101+
The C2440 errors on lines 15 and 16 of the next example are qualified with the `Incompatible calling conventions for UDT return value` message. A *UDT* is a user-defined type, such as a class, struct, or union. These kinds of incompatibility errors are caused when the calling convention of a UDT specified in the return type of a forward declaration conflicts with the actual calling convention of the UDT and when a function pointer is involved.
102102

103103
In the example, first there are forward declarations for a struct and for a function that returns the struct. The compiler assumes that the struct uses the C++ calling convention. Next is the struct definition, which uses the C calling convention by default. Because the compiler doesn't know the calling convention of the struct until it finishes reading the entire struct, the calling convention for the struct in the return type of `get_c2` is also assumed to be C++.
104104

@@ -163,7 +163,7 @@ int main() {
163163

164164
### User-defined conversions
165165

166-
C2440 can also occur for an incorrect use of a user-defined conversion. For example, when a conversion operator has been defined as **`explicit`**, the compiler can't use it in an implicit conversion. For more information about user-defined conversions, see [User-Defined Conversions (C++/CLI)](../../dotnet/user-defined-conversions-cpp-cli.md)). This sample generates C2440:
166+
C2440 can also occur for an incorrect use of a user-defined conversion. For example, when a conversion operator has been defined as **`explicit`**, the compiler can't use it in an implicit conversion. For more information about user-defined conversions, see [User-Defined Conversions (C++/CLI)](../../dotnet/user-defined-conversions-cpp-cli.md)). This example generates C2440:
167167

168168
```cpp
169169
// C2440d.cpp
@@ -187,7 +187,7 @@ int main() {
187187
188188
### `System::Array` creation
189189
190-
C2440 can also occur if you try to create an instance of an array in C++/CLI whose type is a <xref:System.Array>. For more information, see [Arrays](../../extensions/arrays-cpp-component-extensions.md). The next sample generates C2440:
190+
C2440 can also occur if you try to create an instance of an array in C++/CLI whose type is a <xref:System.Array>. For more information, see [Arrays](../../extensions/arrays-cpp-component-extensions.md). The next example generates C2440:
191191
192192
```cpp
193193
// C2440e.cpp
@@ -202,7 +202,7 @@ int main() {
202202

203203
### Attributes
204204

205-
C2440 can also occur because of changes in the attributes feature. The following sample generates C2440.
205+
C2440 can also occur because of changes in the attributes feature. The following example generates C2440.
206206

207207
```cpp
208208
// c2440f.cpp
@@ -218,7 +218,7 @@ The Microsoft C++ compiler no longer allows the [`const_cast` operator](../../cp
218218

219219
To resolve this C2440, use the correct cast operator. For more information, see [Casting operators](../../cpp/casting-operators.md).
220220

221-
This sample generates C2440:
221+
This example generates C2440:
222222

223223
```cpp
224224
// c2440g.cpp
@@ -237,7 +237,7 @@ int main() {
237237
238238
C2440 can occur because of conformance changes to the compiler in Visual Studio 2015 Update 3. Previously, the compiler incorrectly treated certain distinct expressions as the same type when identifying a template match for a **`static_cast`** operation. Now the compiler distinguishes the types correctly, and code that relied on the previous **`static_cast`** behavior is broken. To fix this issue, change the template argument to match the template parameter type, or use a **`reinterpret_cast`** or C-style cast.
239239
240-
This sample generates C2440:
240+
This example generates C2440:
241241
242242
```cpp
243243
// c2440h.cpp

docs/error-messages/compiler-errors-1/compiler-error-c2441.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ For more information, see [process](../../cpp/process.md) and [/clr (Common Lang
2222

2323
## Example
2424

25-
The following sample generates C2441.
25+
The following example generates C2441.
2626

2727
```cpp
2828
// C2441.cpp

docs/error-messages/compiler-errors-1/compiler-error-c2443.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ The instruction requires operands to be the same size.
1616

1717
## Example
1818

19-
The following sample generates C2443:
19+
The following example generates C2443:
2020

2121
```cpp
2222
// C2443.cpp

0 commit comments

Comments
 (0)