Skip to content

Commit bc4469d

Browse files
authored
Add "Remarks" and "Example" headings for error references in range [C2351, C2380]
1 parent 6a31d5f commit bc4469d

24 files changed

+88
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: 5439ccf6-66f6-4859-964c-c73f5eddfc1b
1010

1111
> obsolete C++ constructor initialization syntax
1212
13+
## Remarks
14+
1315
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.
1416

17+
## Example
18+
1519
The following sample generates C2351:
1620

1721
```cpp

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: 0efad8cb-659f-4b3e-8f6f-9f8ec44d345c
1010

1111
> 'class::function' : illegal call of non-static member function
1212
13+
## Remarks
14+
1315
A **`static`** member function called a nonstatic member function. Or, a nonstatic member function was called from outside the class as a static function.
1416

17+
## Examples
18+
1519
The following sample generates C2352 and shows how to fix it:
1620

1721
```cpp

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: d57f8f77-d9b1-4bba-a940-87ec269ad183
1010

1111
> exception specification is not allowed
1212
13+
## Remarks
14+
1315
Exception specifications are not allowed on member functions of managed classes.
1416

17+
## Example
18+
1519
The following sample generates C2353:
1620

1721
```cpp

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,14 @@ ms.assetid: 0a947881-d61f-4f98-8409-32140f39500b
1010

1111
> 'this' : can only be referenced inside non-static member functions or non-static data member initializers
1212
13+
## Remarks
14+
1315
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.
1416

1517
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.
1618

19+
## Example
20+
1721
The following sample generates C2355 and shows how to fix it:
1822

1923
```cpp

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ ms.assetid: 84d5a816-9a61-4d45-9978-38e485bbf767
1010

1111
> initialization segment must not change during translation unit
1212
13+
## Remarks
14+
1315
Possible causes:
1416

1517
- `#pragma init_seg` preceded by segment initialization code
@@ -18,6 +20,8 @@ Possible causes:
1820

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

23+
## Example
24+
2125
The following sample generates C2356:
2226

2327
```cpp

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ ms.assetid: d1083945-0ea2-4385-9e66-8c665978806c
1010

1111
> 'identifier' : must be a function of type 'type'
1212
13+
## Remarks
14+
1315
Your code declares a version of the `atexit` function that does not match the version declared internally by the compiler. Declare `atexit` as follows:
1416

1517
```
@@ -18,6 +20,8 @@ int __cdecl atexit(void (__cdecl *)());
1820

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

23+
## Example
24+
2125
The following sample generates C2357:
2226

2327
```cpp

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: 51bfd2ee-8108-4777-aa93-148b9cebfa83
1010

1111
> initialization of 'identifier' is skipped by 'case' label
1212
13+
## Remarks
14+
1315
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.)
1416

17+
## Example
18+
1519
The following sample generates C2360:
1620

1721
```cpp

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: efbdaeb9-891c-4f7d-97da-89088a8413f3
1010

1111
> initialization of 'identifier' is skipped by 'default' label
1212
13+
## Remarks
14+
1315
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.)
1416

17+
## Example
18+
1519
The following sample generates C2361:
1620

1721
```cpp

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,14 @@ ms.assetid: 7aafecbc-b3cf-45a6-9ec3-a17e3f222511
1010

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

1517
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.
1618

19+
## Example
20+
1721
The following sample generates C2362:
1822

1923
```cpp

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ ms.assetid: 4f550571-94b5-42ca-84cb-663fecbead44
1010

1111
> 'type': illegal type for custom attribute
1212
13+
## Remarks
14+
1315
Named arguments for custom attributes are limited to compile time constants. For example, integral types (int, char, etc.), System::Type^, and System::Object^.
1416

1517
## Example

0 commit comments

Comments
 (0)