Skip to content

Commit 76cfceb

Browse files
authored
Merge pull request #5578 from Rageking8/structure-error-references-in-range-c2351-c2380
Structure error references in range [C2351, C2380]
2 parents c60a010 + 6ff9386 commit 76cfceb

24 files changed

+182
-118
lines changed

docs/error-messages/compiler-errors-1/compiler-error-c2351.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 Error C2351"
32
title: "Compiler Error C2351"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2351"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2351"]
66
helpviewer_keywords: ["C2351"]
7-
ms.assetid: 5439ccf6-66f6-4859-964c-c73f5eddfc1b
87
---
98
# Compiler Error C2351
109

11-
obsolete C++ constructor initialization syntax
10+
> obsolete C++ constructor initialization syntax
11+
12+
## Remarks
1213

1314
In a new-style initialization list for a constructor, you must explicitly name each direct base class, even if it is the only base class.
1415

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

1720
```cpp
1821
// C2351.cpp

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

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
---
2-
description: "Learn more about: Compiler Error C2352"
32
title: "Compiler Error C2352"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2352"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2352"]
66
helpviewer_keywords: ["C2352"]
7-
ms.assetid: 0efad8cb-659f-4b3e-8f6f-9f8ec44d345c
87
---
98
# Compiler Error C2352
109

11-
'class::function' : illegal call of non-static member function
10+
> 'class::function' : illegal call of non-static member function
11+
12+
## Remarks
1213

1314
A **`static`** member function called a nonstatic member function. Or, a nonstatic member function was called from outside the class as a static function.
1415

15-
The following sample generates C2352 and shows how to fix it:
16+
## Examples
17+
18+
The following example generates C2352 and shows how to fix it:
1619

1720
```cpp
1821
// C2352.cpp
@@ -28,7 +31,7 @@ public:
2831
};
2932
```
3033
31-
The following sample generates C2352 and shows how to fix it:
34+
The following example generates C2352 and shows how to fix it:
3235
3336
```cpp
3437
// C2352b.cpp

docs/error-messages/compiler-errors-1/compiler-error-c2353.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 Error C2353"
32
title: "Compiler Error C2353"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2353"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2353"]
66
helpviewer_keywords: ["C2353"]
7-
ms.assetid: d57f8f77-d9b1-4bba-a940-87ec269ad183
87
---
98
# Compiler Error C2353
109

11-
exception specification is not allowed
10+
> exception specification is not allowed
11+
12+
## Remarks
1213

1314
Exception specifications are not allowed on member functions of managed classes.
1415

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

1720
```cpp
1821
// C2353.cpp

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

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,23 @@
11
---
2-
description: "Learn more about: Compiler Error C2355"
32
title: "Compiler Error C2355"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2355"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2355"]
66
helpviewer_keywords: ["C2355"]
7-
ms.assetid: 0a947881-d61f-4f98-8409-32140f39500b
87
---
98
# Compiler Error C2355
109

11-
'this' : can only be referenced inside non-static member functions or non-static data member initializers
10+
> 'this' : can only be referenced inside non-static member functions or non-static data member initializers
11+
12+
## Remarks
1213

1314
The **`this`** pointer is valid only within non-static member functions or in non-static data member initializers. This error can result when the class scope of a member function definition outside of the class declaration is not properly qualified. The error can also occur when the **`this`** pointer is used in a function that is not declared in the class.
1415

1516
To fix this issue, make sure the member function definition matches a member function declaration in the class, and that it is not declared static. For data member initializers, make sure the data member is not declared static.
1617

17-
The following sample generates C2355 and shows how to fix it:
18+
## Example
19+
20+
The following example generates C2355 and shows how to fix it:
1821

1922
```cpp
2023
// C2355.cpp

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

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
---
2-
description: "Learn more about: Compiler Error C2356"
32
title: "Compiler Error C2356"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2356"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2356"]
66
helpviewer_keywords: ["C2356"]
7-
ms.assetid: 84d5a816-9a61-4d45-9978-38e485bbf767
87
---
98
# Compiler Error C2356
109

11-
initialization segment must not change during translation unit
10+
> initialization segment must not change during translation unit
11+
12+
## Remarks
1213

1314
Possible causes:
1415

@@ -18,7 +19,9 @@ Possible causes:
1819

1920
To resolve, move the segment initialization code to the beginning of the module. If multiple areas must be initialized, move them to separate modules.
2021

21-
The following sample generates C2356:
22+
## Example
23+
24+
The following example generates C2356:
2225

2326
```cpp
2427
// C2356.cpp

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

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
---
2-
description: "Learn more about: Compiler Error C2357"
32
title: "Compiler Error C2357"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2357"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2357"]
66
helpviewer_keywords: ["C2357"]
7-
ms.assetid: d1083945-0ea2-4385-9e66-8c665978806c
87
---
98
# Compiler Error C2357
109

11-
'identifier' : must be a function of type 'type'
10+
> 'identifier' : must be a function of type 'type'
11+
12+
## Remarks
1213

1314
Your code declares a version of the `atexit` function that does not match the version declared internally by the compiler. Declare `atexit` as follows:
1415

@@ -18,7 +19,9 @@ int __cdecl atexit(void (__cdecl *)());
1819

1920
For more information, see [init_seg](../../preprocessor/init-seg.md).
2021

21-
The following sample generates C2357:
22+
## Example
23+
24+
The following example generates C2357:
2225

2326
```cpp
2427
// C2357.cpp

docs/error-messages/compiler-errors-1/compiler-error-c2360.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 Error C2360"
32
title: "Compiler Error C2360"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2360"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2360"]
66
helpviewer_keywords: ["C2360"]
7-
ms.assetid: 51bfd2ee-8108-4777-aa93-148b9cebfa83
87
---
98
# Compiler Error C2360
109

11-
initialization of 'identifier' is skipped by 'case' label
10+
> initialization of 'identifier' is skipped by 'case' label
11+
12+
## Remarks
1213

1314
The initialization of `identifier` can be skipped in a **`switch`** statement. You cannot jump past a declaration with an initializer unless the declaration is enclosed in a block. (Unless it is declared within a block, the variable is within scope until the end of the **`switch`** statement.)
1415

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

1720
```cpp
1821
// C2360.cpp

docs/error-messages/compiler-errors-1/compiler-error-c2361.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 Error C2361"
32
title: "Compiler Error C2361"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2361"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2361"]
66
helpviewer_keywords: ["C2361"]
7-
ms.assetid: efbdaeb9-891c-4f7d-97da-89088a8413f3
87
---
98
# Compiler Error C2361
109

11-
initialization of 'identifier' is skipped by 'default' label
10+
> initialization of 'identifier' is skipped by 'default' label
11+
12+
## Remarks
1213

1314
The initialization of `identifier` can be skipped in a **`switch`** statement. You cannot jump past a declaration with an initializer unless the declaration is enclosed in a block. (Unless it is declared within a block, the variable is within scope until the end of the **`switch`** statement.)
1415

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

1720
```cpp
1821
// C2361.cpp

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,23 @@
11
---
2-
description: "Learn more about: Compiler Error C2362"
32
title: "Compiler Error C2362"
4-
ms.date: "06/03/2019"
3+
description: "Learn more about: Compiler Error C2362"
4+
ms.date: 06/03/2019
55
f1_keywords: ["C2362"]
66
helpviewer_keywords: ["C2362"]
7-
ms.assetid: 7aafecbc-b3cf-45a6-9ec3-a17e3f222511
87
---
98
# Compiler Error C2362
109

1110
> initialization of '*identifier*' is skipped by 'goto *label*'
1211
12+
## Remarks
13+
1314
When compiled by using [/Za](../../build/reference/za-ze-disable-language-extensions.md), a jump to the label prevents the identifier from being initialized.
1415

1516
You can only jump past a declaration with an initializer if the declaration is enclosed in a block that isn't entered, or if the variable has already been initialized.
1617

17-
The following sample generates C2362:
18+
## Example
19+
20+
The following example generates C2362:
1821

1922
```cpp
2023
// C2362.cpp

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11
---
2-
description: "Learn more about: Compiler Error C2364"
32
title: "Compiler Error C2364"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C2364"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C2364"]
66
helpviewer_keywords: ["C2364"]
7-
ms.assetid: 4f550571-94b5-42ca-84cb-663fecbead44
87
---
98
# Compiler Error C2364
109

11-
'type': illegal type for custom attribute
10+
> 'type': illegal type for custom attribute
11+
12+
## Remarks
1213

1314
Named arguments for custom attributes are limited to compile time constants. For example, integral types (int, char, etc.), System::Type^, and System::Object^.
1415

1516
## Example
1617

17-
The following sample generates C2364.
18+
The following example generates C2364.
1819

1920
```cpp
2021
// c2364.cpp

0 commit comments

Comments
 (0)