Skip to content

Commit b345eb1

Browse files
authored
Merge pull request #5715 from Rageking8/structure-warning-references-in-range-c4231-c4270
Structure warning references in range [C4231, C4270]
2 parents ac3c8fb + f4f370d commit b345eb1

25 files changed

+164
-89
lines changed

docs/error-messages/compiler-warnings/compiler-warning-level-1-c4237.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
---
2-
description: "Learn more about: Compiler Warning (level 1) C4237"
32
title: "Compiler Warning (level 1) C4237"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Warning (level 1) C4237"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C4237"]
66
helpviewer_keywords: ["C4237"]
7-
ms.assetid: f2e86c4b-80d8-460e-9429-83c5f3f5d7ca
87
---
98
# Compiler Warning (level 1) C4237
109

11-
'keyword' keyword is not yet supported, but reserved for future use
10+
> 'keyword' keyword is not yet supported, but reserved for future use
11+
12+
## Remarks
1213

1314
A keyword in the C++ specification is not implemented in the Microsoft C++ compiler, but the keyword is not available as a user-defined symbol.
1415

15-
The following sample generates C4237:
16+
## Example
17+
18+
The following example generates C4237:
1619

1720
```cpp
1821
// C4237.cpp

docs/error-messages/compiler-warnings/compiler-warning-level-1-c4251.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ Think carefully about adding `__declspec(dllexport)` or `__declspec(dllimport)`
3232

3333
## Example
3434

35+
The following example generates C4251:
36+
3537
```cpp
3638
// C4251.cpp
3739
// Compile with /std:c++20 /EHsc /W2 /c C4251.cpp

docs/error-messages/compiler-warnings/compiler-warning-level-1-c4258.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,21 @@
11
---
2-
description: "Learn more about: Compiler Warning (level 1) C4258"
32
title: "Compiler Warning (level 1) C4258"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Warning (level 1) C4258"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C4258"]
66
helpviewer_keywords: ["C4258"]
7-
ms.assetid: bbb75e6d-6693-4e62-8ed3-b006a0ec55e3
87
---
98
# Compiler Warning (level 1) C4258
109

11-
'variable' : definition from the for loop is ignored; the definition from the enclosing scope is used"
10+
> 'variable' : definition from the for loop is ignored; the definition from the enclosing scope is used"
11+
12+
## Remarks
13+
14+
Under [/Ze](../../build/reference/za-ze-disable-language-extensions.md) and [/Zc:forScope](../../build/reference/zc-forscope-force-conformance-in-for-loop-scope.md), variables defined in a [for](../../cpp/for-statement-cpp.md) loop go out of scope after the **`for`** loop ends. This warning occurs if a variable with the same name as the loop variable, but defined in the enclosing loop, is used again in the scope containing the **`for`** loop.
15+
16+
## Example
1217

13-
Under [/Ze](../../build/reference/za-ze-disable-language-extensions.md) and [/Zc:forScope](../../build/reference/zc-forscope-force-conformance-in-for-loop-scope.md), variables defined in a [for](../../cpp/for-statement-cpp.md) loop go out of scope after the **`for`** loop ends. This warning occurs if a variable with the same name as the loop variable, but defined in the enclosing loop, is used again in the scope containing the **`for`** loop. For example:
18+
For example:
1419

1520
```cpp
1621
// C4258.cpp
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
---
2-
description: "Learn more about: Compiler Warning (level 4, off) C4264"
32
title: "Compiler Warning (level 4, off) C4264"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Warning (level 4, off) C4264"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C4264"]
66
helpviewer_keywords: ["C4264"]
77
---
88
# Compiler Warning (level 4, off) C4264
99

1010
> 'virtual_function' : no override available for virtual member function from base 'class'; function is hidden
1111
12+
## Remarks
13+
1214
C4264 is always generated after [C4263](../../error-messages/compiler-warnings/compiler-warning-level-4-c4263.md).
1315

1416
This warning is off by default. For more information, see [Compiler Warnings That Are Off by Default](../../preprocessor/compiler-warnings-that-are-off-by-default.md).

docs/error-messages/compiler-warnings/compiler-warning-level-1-c4269.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,16 @@ helpviewer_keywords: ["C4269"]
77
---
88
# Compiler Warning (level 1) C4269
99

10-
'identifier' : 'const' automatic data initialized with compiler generated default constructor produces unreliable results
10+
> 'identifier' : 'const' automatic data initialized with compiler generated default constructor produces unreliable results
11+
12+
## Remarks
1113

1214
A **`const`** automatic instance of a non-trivial class is initialized with a compiler-generated default constructor.
1315

1416
## Example
1517

18+
The following example generates C4269:
19+
1620
```cpp
1721
// C4269.cpp
1822
// compile with: /c /LD /W1

docs/error-messages/compiler-warnings/compiler-warning-level-2-c4244.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
---
2-
description: "Learn more about: Compiler Warning (level 2) C4244"
32
title: "Compiler Warning (level 2) C4244"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Warning (level 2) C4244"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C4244"]
66
helpviewer_keywords: ["C4244"]
7-
ms.assetid: 2c19d157-21d1-42c2-a6c0-3f30f2ce3813
87
---
98
# Compiler Warning (level 2) C4244
109

11-
'argument' : conversion from 'type1' to 'type2', possible loss of data
10+
> 'argument' : conversion from 'type1' to 'type2', possible loss of data
11+
12+
## Remarks
1213

1314
A floating point type was converted to an integer type. A possible loss of data may have occurred.
1415

@@ -18,7 +19,7 @@ C4244 can also fire at level 3, and 4; see [Compiler Warning (levels 3 and 4) C4
1819

1920
## Example
2021

21-
The following sample generates C4244:
22+
The following example generates C4244:
2223

2324
```cpp
2425
// C4244_level2.cpp

docs/error-messages/compiler-warnings/compiler-warning-level-2-c4250.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
---
2-
description: "Learn more about: Compiler Warning (level 2) C4250"
32
title: "Compiler Warning (level 2) C4250"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Warning (level 2) C4250"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C4250"]
66
helpviewer_keywords: ["C4250"]
7-
ms.assetid: d47f7249-6b5a-414b-b2d4-56e5d246a782
87
---
98
# Compiler Warning (level 2) C4250
109

11-
'class1' : inherits 'class2::member' via dominance
10+
> 'class1' : inherits 'class2::member' via dominance
11+
12+
## Remarks
1213

1314
Two or more members have the same name. The one in `class2` is inherited because it is a base class for the other classes that contained this member.
1415

@@ -18,6 +19,8 @@ Because a virtual base class is shared among multiple derived classes, a name in
1819

1920
## Examples
2021

22+
The following example generates C4250:
23+
2124
```cpp
2225
// C4250.cpp
2326
// compile with: /c /W2
@@ -40,7 +43,7 @@ int main() {
4043
}
4144
```
4245
43-
The following sample generates C4250.
46+
The following example generates C4250.
4447
4548
```cpp
4649
// C4250_b.cpp
@@ -71,7 +74,7 @@ int main() {
7174
}
7275
```
7376

74-
This sample shows a more complex situation. The following sample generates C4250.
77+
This example shows a more complex situation. The following example generates C4250.
7578

7679
```cpp
7780
// C4250_c.cpp

docs/error-messages/compiler-warnings/compiler-warning-level-3-c4240.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
11
---
2-
description: "Learn more about: Compiler Warning (level 3) C4240"
32
title: "Compiler Warning (level 3) C4240"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Warning (level 3) C4240"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C4240"]
66
helpviewer_keywords: ["C4240"]
7-
ms.assetid: a2657cdb-18e1-493f-882b-4e10c0bca71d
87
---
98
# Compiler Warning (level 3) C4240
109

11-
nonstandard extension used : access to 'classname' now defined to be 'access specifier', previously it was defined to be 'access specifier'
10+
> nonstandard extension used : access to 'classname' now defined to be 'access specifier', previously it was defined to be 'access specifier'
11+
12+
## Remarks
1213

1314
Under ANSI compatibility ([/Za](../../build/reference/za-ze-disable-language-extensions.md)), you cannot change the access to a nested class. Under the default Microsoft extensions (/Ze), you can, with this warning.
1415

1516
## Example
1617

18+
The following example generates C4240:
19+
1720
```cpp
1821
// C4240.cpp
1922
// compile with: /W3

docs/error-messages/compiler-warnings/compiler-warning-level-3-c4243.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,15 @@ helpviewer_keywords: ["C4243"]
77
---
88
# Compiler Warning (level 3) C4243
99

10-
'conversion type' conversion exists from 'type1' to 'type2', but is inaccessible
10+
> 'conversion type' conversion exists from 'type1' to 'type2', but is inaccessible
11+
12+
## Remarks
1113

1214
A pointer to a derived class is converted to a pointer to a base class, but the derived class inherits the base class with private or protected access.
1315

14-
The following sample generates C4243:
16+
## Example
17+
18+
The following example generates C4243:
1519

1620
```cpp
1721
// C4243.cpp

docs/error-messages/compiler-warnings/compiler-warning-level-3-c4265.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,23 @@
11
---
2-
description: "Learn more about: Compiler Warning (level 3, off) C4265"
32
title: "Compiler Warning (level 3, off) C4265"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Warning (level 3, off) C4265"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C4265"]
66
helpviewer_keywords: ["C4265"]
77
---
88
# Compiler Warning (level 3, off) C4265
99

1010
> '*classname*': class has virtual functions, but its non-trivial destructor is not virtual; instances of this class may not be destructed correctly
1111
12+
## Remarks
13+
1214
When a class has virtual functions but a nonvirtual destructor, objects of the type might not be destroyed properly when the class is destroyed through a base class pointer.
1315

1416
This warning is off by default. For more information, see [Compiler Warnings That Are Off by Default](../../preprocessor/compiler-warnings-that-are-off-by-default.md).
1517

16-
The following sample generates C4265:
18+
## Example
19+
20+
The following example generates C4265:
1721

1822
```cpp
1923
// C4265.cpp

0 commit comments

Comments
 (0)